Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

simmot_n.cc

Go to the documentation of this file.
00001 /*
00002 *       New C++ File starts here.
00003 *       This file should be named simmot_n.cpp
00004 */
00005 
00006 // Include all NML, CMS, and RCS classes and functions
00007 #include "rcs.hh"
00008 
00009 // Include command and status message definitions
00010 #include "simmot_n.h"
00011 #include "amplifier.h"
00012 #include "dcmotor2.h"
00013 #include "encoder.h"
00014 
00015 // Forward Function Prototypes
00016 void simmot_status_struct_update(CMS *cms, simmot_status_struct *x);
00017 void AMPLIFIER_STRUCT_update(CMS *cms, AMPLIFIER_STRUCT *x);
00018 void DC_MOTOR_STRUCT_update(CMS *cms, DC_MOTOR_STRUCT *x);
00019 void ENCODER_STRUCT_update(CMS *cms, ENCODER_STRUCT *x);
00020 void simmot_command_struct_update(CMS *cms, simmot_command_struct *x);
00021 
00022 /*
00023 *       NML/CMS Format function : simmot_format
00024 *       Automatically generated by RCS Java Diagnostics Tool.
00025 *       on Tue Oct 24 13:02:56 GMT-5:00 2000
00026 */
00027 int simmot_format(NMLTYPE type, void *buffer, CMS *cms)
00028 {
00029         switch(type)
00030         {
00031         case SIMMOT_COMMAND_TYPE:
00032                 ((SIMMOT_COMMAND *) buffer)->update(cms);
00033                 break;
00034         case SIMMOT_STATUS_TYPE:
00035                 ((SIMMOT_STATUS *) buffer)->update(cms);
00036                 break;
00037 
00038         default:
00039                 return(0);
00040         }
00041         return 1;
00042 }
00043 
00044 
00045 // NML Symbol Lookup Function
00046 const char *simmot_symbol_lookup(int type)
00047 {
00048         switch(type)
00049         {
00050         case SIMMOT_COMMAND_TYPE:
00051                 return "SIMMOT_COMMAND";
00052         case SIMMOT_STATUS_TYPE:
00053                 return "SIMMOT_STATUS";
00054         default:
00055                 return"UNKNOWN";
00056                 break;
00057         }
00058         return(NULL);
00059 }
00060 
00061 /*
00062 *       NML/CMS Update function for simmot_status_struct
00063 *       Automatically generated by RCS Java Diagnostics Tool.
00064 *       on Tue Oct 24 13:02:56 GMT-5:00 2000
00065 */
00066 void simmot_status_struct_update(CMS *cms,simmot_status_struct *x)
00067 {
00068         cms->update(x->initialized);
00069         cms->update(x->cmd_count);
00070         cms->update(x->ampOutput,8);
00071         for(int i_amplifier = 0;i_amplifier < 8 ;i_amplifier++)
00072                 AMPLIFIER_STRUCT_update(cms,&(x->amplifier[i_amplifier]));
00073         for(int i_dcmotor = 0;i_dcmotor < 8 ;i_dcmotor++)
00074                 DC_MOTOR_STRUCT_update(cms,&(x->dcmotor[i_dcmotor]));
00075         for(int i_encoder = 0;i_encoder < 8 ;i_encoder++)
00076                 ENCODER_STRUCT_update(cms,&(x->encoder[i_encoder]));
00077 
00078 }
00079 
00080 
00081 /*
00082 *       NML/CMS Update function for DC_MOTOR_STRUCT
00083 *       Automatically generated by RCS Java Diagnostics Tool.
00084 *       on Tue Oct 24 13:02:56 GMT-5:00 2000
00085 */
00086 void DC_MOTOR_STRUCT_update(CMS *cms,DC_MOTOR_STRUCT *x)
00087 {
00088         cms->update(x->Ra);
00089         cms->update(x->La);
00090         cms->update(x->Kb);
00091         cms->update(x->Jm);
00092         cms->update(x->Bm);
00093         cms->update(x->a);
00094         cms->update(x->b);
00095         cms->update(x->c);
00096         cms->update(x->fourac_minus_b_squared);
00097         cms->update(x->sa_real);
00098         cms->update(x->sb_real);
00099         cms->update(x->sa_img);
00100         cms->update(x->sb_img);
00101         cms->update(x->sa_time_factor);
00102         cms->update(x->sb_time_factor);
00103         cms->update(x->order);
00104         cms->update(x->wo);
00105         cms->update(x->dwo);
00106         cms->update(x->last_ea);
00107         cms->update(x->A);
00108         cms->update(x->B);
00109         cms->update(x->delta_thm);
00110         cms->update(x->ia);
00111         cms->update(x->dia);
00112         cms->update(x->wm);
00113         cms->update(x->dwm);
00114         cms->update(x->thm);
00115         cms->update(x->dthm);
00116         cms->update(x->lastTime);
00117         cms->update(x->configured);
00118         cms->update(x->cycleTime);
00119         cms->update(x->offset);
00120         cms->update(x->revsPerUnit);
00121 
00122 }
00123 
00124 
00125 /*
00126 *       NML/CMS Update function for SIMMOT_STATUS
00127 *       Automatically generated by RCS Java Diagnostics Tool.
00128 *       on Tue Oct 24 13:02:56 GMT-5:00 2000
00129 */
00130 void SIMMOT_STATUS::update(CMS *cms)
00131 {
00132         simmot_status_struct_update(cms,&data);
00133 
00134 }
00135 
00136 
00137 /*
00138 *       NML/CMS Update function for AMPLIFIER_STRUCT
00139 *       Automatically generated by RCS Java Diagnostics Tool.
00140 *       on Tue Oct 24 13:02:56 GMT-5:00 2000
00141 */
00142 void AMPLIFIER_STRUCT_update(CMS *cms,AMPLIFIER_STRUCT *x)
00143 {
00144         cms->update(x->gain);
00145         cms->update(x->maxOutputCurrent);
00146         cms->update(x->loadResistance);
00147         cms->update(x->configured);
00148         cms->update(x->enabled);
00149         cms->update(x->tripped);
00150 
00151 }
00152 
00153 
00154 /*
00155 *       NML/CMS Update function for ENCODER_STRUCT
00156 *       Automatically generated by RCS Java Diagnostics Tool.
00157 *       on Tue Oct 24 13:02:56 GMT-5:00 2000
00158 */
00159 void ENCODER_STRUCT_update(CMS *cms,ENCODER_STRUCT *x)
00160 {
00161         cms->update(x->countsPerRev);
00162         cms->update(x->configured);
00163         cms->update(x->counts);
00164         cms->update(x->calibrating);
00165         cms->update(x->offset);
00166         cms->update(x->lastPosition);
00167         cms->update(x->index);
00168 
00169 }
00170 
00171 
00172 /*
00173 *       NML/CMS Update function for simmot_command_struct
00174 *       Automatically generated by RCS Java Diagnostics Tool.
00175 *       on Tue Oct 24 13:02:56 GMT-5:00 2000
00176 */
00177 void simmot_command_struct_update(CMS *cms,simmot_command_struct *x)
00178 {
00179         for(int i_amplifier = 0;i_amplifier < 8 ;i_amplifier++)
00180                 AMPLIFIER_STRUCT_update(cms,&(x->amplifier[i_amplifier]));
00181         for(int i_dcmotor = 0;i_dcmotor < 8 ;i_dcmotor++)
00182                 DC_MOTOR_STRUCT_update(cms,&(x->dcmotor[i_dcmotor]));
00183         for(int i_encoder = 0;i_encoder < 8 ;i_encoder++)
00184                 ENCODER_STRUCT_update(cms,&(x->encoder[i_encoder]));
00185 
00186 }
00187 
00188 
00189 /*
00190 *       NML/CMS Update function for SIMMOT_COMMAND
00191 *       Automatically generated by RCS Java Diagnostics Tool.
00192 *       on Tue Oct 24 13:02:56 GMT-5:00 2000
00193 */
00194 void SIMMOT_COMMAND::update(CMS *cms)
00195 {
00196         simmot_command_struct_update(cms,&data);
00197 
00198 }
00199 
00200 /*
00201 *       Constructor for SIMMOT_STATUS
00202 *       Automatically generated by RCS Java Diagnostics Tool.
00203 *       on Tue Oct 24 13:02:56 GMT-5:00 2000
00204 */
00205 SIMMOT_STATUS::SIMMOT_STATUS()
00206         : NMLmsg(SIMMOT_STATUS_TYPE,sizeof(SIMMOT_STATUS))
00207 {
00208         /*
00209         * If the class simmot_status_struct does not initialize its members,
00210         * then the members of data should be initialized here.
00211         */
00212 
00213 
00214 }
00215 
00216 /*
00217 *       Constructor for SIMMOT_COMMAND
00218 *       Automatically generated by RCS Java Diagnostics Tool.
00219 *       on Tue Oct 24 13:02:56 GMT-5:00 2000
00220 */
00221 SIMMOT_COMMAND::SIMMOT_COMMAND()
00222         : NMLmsg(SIMMOT_COMMAND_TYPE,sizeof(SIMMOT_COMMAND))
00223 {
00224         /*
00225         * If the class simmot_command_struct does not initialize its members,
00226         * then the members of data should be initialized here.
00227         */
00228 
00229 
00230 }

Generated on Sun Dec 2 15:27:43 2001 for EMC by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001