Repetier-Firmware  0.91
src/ArduinoAVR/Repetier/Communication.h
Go to the documentation of this file.
00001 /*
00002     This file is part of Repetier-Firmware.
00003 
00004     Repetier-Firmware is free software: you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation, either version 3 of the License, or
00007     (at your option) any later version.
00008 
00009     Repetier-Firmware is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with Repetier-Firmware.  If not, see <http://www.gnu.org/licenses/>.
00016 
00017     This firmware is a nearly complete rewrite of the sprinter firmware
00018     by kliment (https://github.com/kliment/Sprinter)
00019     which based on Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
00020 */
00021 
00022 #ifndef COMMUNICATION_H
00023 #define COMMUNICATION_H
00024 
00025 class Com
00026 {
00027     public:
00028 FSTRINGVAR(tDebug)
00029 FSTRINGVAR(tFirmware)
00030 FSTRINGVAR(tOk)
00031 FSTRINGVAR(tNewline)
00032 FSTRINGVAR(tNAN)
00033 FSTRINGVAR(tINF)
00034 FSTRINGVAR(tError)
00035 FSTRINGVAR(tInfo)
00036 FSTRINGVAR(tWarning)
00037 FSTRINGVAR(tResend)
00038 FSTRINGVAR(tEcho)
00039 FSTRINGVAR(tOkSpace)
00040 FSTRINGVAR(tWrongChecksum)
00041 FSTRINGVAR(tMissingChecksum)
00042 FSTRINGVAR(tFormatError)
00043 FSTRINGVAR(tDonePrinting)
00044 FSTRINGVAR(tX)
00045 FSTRINGVAR(tY)
00046 FSTRINGVAR(tZ)
00047 FSTRINGVAR(tE)
00048 FSTRINGVAR(tF)
00049 FSTRINGVAR(tS)
00050 FSTRINGVAR(tP)
00051 FSTRINGVAR(tI)
00052 FSTRINGVAR(tJ)
00053 FSTRINGVAR(tR)
00054 FSTRINGVAR(tSDReadError)
00055 FSTRINGVAR(tExpectedLine)
00056 FSTRINGVAR(tGot)
00057 FSTRINGVAR(tSkip)
00058 FSTRINGVAR(tBLK)
00059 FSTRINGVAR(tStart)
00060 FSTRINGVAR(tPowerUp)
00061 FSTRINGVAR(tExternalReset)
00062 FSTRINGVAR(tBrownOut)
00063 FSTRINGVAR(tWatchdog)
00064 FSTRINGVAR(tSoftwareReset)
00065 FSTRINGVAR(tUnknownCommand)
00066 FSTRINGVAR(tFreeRAM)
00067 FSTRINGVAR(tXColon)
00068 FSTRINGVAR(tSlash)
00069 FSTRINGVAR(tSpaceXColon)
00070 FSTRINGVAR(tSpaceYColon)
00071 FSTRINGVAR(tSpaceZColon)
00072 FSTRINGVAR(tSpaceEColon)
00073 FSTRINGVAR(tTColon)
00074 FSTRINGVAR(tSpaceBColon)
00075 FSTRINGVAR(tSpaceAtColon)
00076 FSTRINGVAR(tSpaceT)
00077 FSTRINGVAR(tSpaceRaw)
00078 FSTRINGVAR(tSpaceAt)
00079 FSTRINGVAR(tSpaceBAtColon)
00080 FSTRINGVAR(tColon)
00081 FSTRINGVAR(tSpeedMultiply);
00082 FSTRINGVAR(tFlowMultiply);
00083 FSTRINGVAR(tFanspeed);
00084 FSTRINGVAR(tPrintedFilament)
00085 FSTRINGVAR(tPrintingTime)
00086 FSTRINGVAR(tSpacem)
00087 FSTRINGVAR(tSpaceDaysSpace)
00088 FSTRINGVAR(tSpaceHoursSpace)
00089 FSTRINGVAR(tSpaceMin)
00090 FSTRINGVAR(tInvalidArc)
00091 FSTRINGVAR(tComma)
00092 FSTRINGVAR(tSpace)
00093 FSTRINGVAR(tYColon)
00094 FSTRINGVAR(tZColon)
00095 FSTRINGVAR(tE0Colon)
00096 FSTRINGVAR(tE1Colon)
00097 FSTRINGVAR(tMS1MS2Pins)
00098 FSTRINGVAR(tSetOutputSpace)
00099 FSTRINGVAR(tSpaceToSpace)
00100 FSTRINGVAR(tHSpace)
00101 FSTRINGVAR(tLSpace)
00102 FSTRINGVAR(tXMinColon)
00103 FSTRINGVAR(tXMaxColon)
00104 FSTRINGVAR(tYMinColon)
00105 FSTRINGVAR(tYMaxColon)
00106 FSTRINGVAR(tZMinColon)
00107 FSTRINGVAR(tZMaxColon)
00108 FSTRINGVAR(tJerkColon)
00109 FSTRINGVAR(tZJerkColon)
00110 FSTRINGVAR(tLinearStepsColon)
00111 FSTRINGVAR(tQuadraticStepsColon)
00112 FSTRINGVAR(tCommaSpeedEqual)
00113 FSTRINGVAR(tLinearLColon)
00114 FSTRINGVAR(tQuadraticKColon)
00115 FSTRINGVAR(tEEPROMUpdated)
00116 
00117 #if DRIVE_SYSTEM==3
00118 FSTRINGVAR(tMeasurementReset)
00119 FSTRINGVAR(tMeasureDeltaSteps)
00120 FSTRINGVAR(tMeasureDelta)
00121 FSTRINGVAR(tMeasureOriginReset)
00122 FSTRINGVAR(tMeasurementAbortedOrigin)
00123 FSTRINGVAR(tInvalidDeltaCoordinate)
00124 FSTRINGVAR(tLevelingCalc)
00125 FSTRINGVAR(tTower1)
00126 FSTRINGVAR(tTower2)
00127 FSTRINGVAR(tTower3)
00128 FSTRINGVAR(tDeltaAlphaA)
00129 FSTRINGVAR(tDeltaAlphaB)
00130 FSTRINGVAR(tDeltaAlphaC)
00131 FSTRINGVAR(tDeltaRadiusCorrectionA)
00132 FSTRINGVAR(tDeltaRadiusCorrectionB)
00133 FSTRINGVAR(tDeltaRadiusCorrectionC)
00134 FSTRINGVAR(tDBGDeltaNoMoveinDSegment)
00135 #endif // DRIVE_SYSTEM
00136 #if DRIVE_SYSTEM==4
00137 FSTRINGVAR(tInvalidDeltaCoordinate)
00138 FSTRINGVAR(tDBGDeltaNoMoveinDSegment)
00139 FSTRINGVAR(tEPRDiagonalRodLength)
00140 #endif
00141 #ifdef DEBUG_GENERIC
00142 FSTRINGVAR(tGenTemp)
00143 #endif // DEBUG_GENERICFSTRINGVALUE(Com::,"")
00144 FSTRINGVAR(tTargetExtr)
00145 FSTRINGVAR(tTargetBedColon)
00146 FSTRINGVAR(tPIDAutotuneStart)
00147 FSTRINGVAR(tAPIDBias)
00148 FSTRINGVAR(tAPIDD)
00149 FSTRINGVAR(tAPIDMin)
00150 FSTRINGVAR(tAPIDMax)
00151 FSTRINGVAR(tAPIDKu)
00152 FSTRINGVAR(tAPIDTu)
00153 FSTRINGVAR(tAPIDClassic)
00154 FSTRINGVAR(tAPIDKp)
00155 FSTRINGVAR(tAPIDKi)
00156 FSTRINGVAR(tAPIDKd)
00157 FSTRINGVAR(tAPIDFailedHigh)
00158 FSTRINGVAR(tAPIDFailedTimeout)
00159 FSTRINGVAR(tAPIDFinished)
00160 FSTRINGVAR(tMTEMPColon)
00161 FSTRINGVAR(tHeatedBed)
00162 FSTRINGVAR(tExtruderSpace)
00163 FSTRINGVAR(tTempSensorDefect)
00164 FSTRINGVAR(tTempSensorWorking)
00165 FSTRINGVAR(tDryModeUntilRestart)
00166 #ifdef DEBUG_QUEUE_MOVE
00167 FSTRINGVAR(tDBGId)
00168 FSTRINGVAR(tDBGVStartEnd)
00169 FSTRINGVAR(tDBAccelSteps)
00170 FSTRINGVAR(tDBGStartEndSpeed)
00171 FSTRINGVAR(tDBGFlags)
00172 FSTRINGVAR(tDBGJoinFlags)
00173 FSTRINGVAR(tDBGDelta)
00174 FSTRINGVAR(tDBGDir)
00175 FSTRINGVAR(tDBGFullSpeed)
00176 FSTRINGVAR(tDBGVMax)
00177 FSTRINGVAR(tDBGAcceleration)
00178 FSTRINGVAR(tDBGAccelerationPrim)
00179 FSTRINGVAR(tDBGRemainingSteps)
00180 FSTRINGVAR(tDBGAdvanceFull)
00181 FSTRINGVAR(tDBGAdvanceRate)
00182 FSTRINGVAR(tDBGLimitInterval)
00183 FSTRINGVAR(tDBGMoveDistance)
00184 FSTRINGVAR(tDBGCommandedFeedrate)
00185 FSTRINGVAR(tDBGConstFullSpeedMoveTime)
00186 #endif // DEBUG_QUEUE_MOVEFSTRINGVALUE(Com::,"")
00187 #ifdef DEBUG_DELTA_OVERFLOW
00188 FSTRINGVAR(tDBGDeltaOverflow)
00189 #endif // DEBUG_DELTA_OVERFLOW
00190 #ifdef DEBUG_SPLIT
00191 FSTRINGVAR(tDBGDeltaSeconds)
00192 FSTRINGVAR(tDBGDeltaZDelta)
00193 FSTRINGVAR(tDBGDeltaSegments)
00194 FSTRINGVAR(tDBGDeltaNumLines)
00195 FSTRINGVAR(tDBGDeltaSegmentsPerLine)
00196 FSTRINGVAR(tDBGDeltaMaxDS)
00197 FSTRINGVAR(tDBGDeltaStepsPerSegment)
00198 FSTRINGVAR(tDBGDeltaVirtualAxisSteps)
00199 #endif
00200 #ifdef DEBUG_STEPCOUNT
00201 FSTRINGVAR(tDBGMissedSteps)
00202 #endif
00203 #if FEATURE_Z_PROBE
00204 FSTRINGVAR(tZProbe)
00205 FSTRINGVAR(tZProbeState)
00206 FSTRINGVAR(tZProbeStartScript)
00207 FSTRINGVAR(tZProbeEndScript)
00208 FSTRINGVAR(tHitZProbe)
00209 FSTRINGVAR(tZProbeAverage)
00210 FSTRINGVAR(tZProbeZReset)
00211 FSTRINGVAR(tAutolevelReset)
00212 #endif
00213 FSTRINGVAR(tAutolevelEnabled)
00214 FSTRINGVAR(tAutolevelDisabled)
00215 FSTRINGVAR(tZProbeFailed)
00216 FSTRINGVAR(tZProbeMax)
00217 FSTRINGVAR(tZProbePrinterHeight)
00218 
00219 #ifdef WAITING_IDENTIFIER
00220 FSTRINGVAR(tWait)
00221 #endif // WAITING_IDENTIFIER
00222 
00223 #if EEPROM_MODE==0
00224 FSTRINGVAR(tNoEEPROMSupport)
00225 #else
00226 #if FEATURE_Z_PROBE
00227 FSTRINGVAR(tZProbeHeight)
00228 FSTRINGVAR(tZProbeOffsetX)
00229 FSTRINGVAR(tZProbeOffsetY)
00230 FSTRINGVAR(tZProbeSpeed)
00231 FSTRINGVAR(tZProbeSpeedXY)
00232 FSTRINGVAR(tZProbeX1)
00233 FSTRINGVAR(tZProbeY1)
00234 FSTRINGVAR(tZProbeX2)
00235 FSTRINGVAR(tZProbeY2)
00236 FSTRINGVAR(tZProbeX3)
00237 FSTRINGVAR(tZProbeY3)
00238 #endif
00239 #if FEATURE_AUTOLEVEL
00240 FSTRINGVAR(tAutolevelActive)
00241 #endif
00242 FSTRINGVAR(tConfigStoredEEPROM)
00243 FSTRINGVAR(tConfigLoadedEEPROM)
00244 FSTRINGVAR(tEPRConfigResetDefaults)
00245 FSTRINGVAR(tEPRProtocolChanged)
00246 FSTRINGVAR(tExtrDot)
00247 FSTRINGVAR(tEPR0)
00248 FSTRINGVAR(tEPR1)
00249 FSTRINGVAR(tEPR2)
00250 FSTRINGVAR(tEPR3)
00251 FSTRINGVAR(tEPRBaudrate)
00252 FSTRINGVAR(tEPRFilamentPrinted)
00253 FSTRINGVAR(tEPRPrinterActive)
00254 FSTRINGVAR(tEPRMaxInactiveTime)
00255 FSTRINGVAR(tEPRStopAfterInactivty)
00256 FSTRINGVAR(tEPRMaxJerk)
00257 FSTRINGVAR(tEPRXHomePos)
00258 FSTRINGVAR(tEPRYHomePos)
00259 FSTRINGVAR(tEPRZHomePos)
00260 FSTRINGVAR(tEPRXMaxLength)
00261 FSTRINGVAR(tEPRYMaxLength)
00262 FSTRINGVAR(tEPRZMaxLength)
00263 FSTRINGVAR(tEPRXBacklash)
00264 FSTRINGVAR(tEPRYBacklash)
00265 FSTRINGVAR(tEPRZBacklash)
00266 FSTRINGVAR(tEPRZAcceleration)
00267 FSTRINGVAR(tEPRZTravelAcceleration)
00268 FSTRINGVAR(tEPRZStepsPerMM)
00269 FSTRINGVAR(tEPRZMaxFeedrate)
00270 FSTRINGVAR(tEPRZHomingFeedrate)
00271 #if DRIVE_SYSTEM!=3
00272 FSTRINGVAR(tEPRMaxZJerk)
00273 FSTRINGVAR(tEPRXStepsPerMM)
00274 FSTRINGVAR(tEPRYStepsPerMM)
00275 FSTRINGVAR(tEPRXMaxFeedrate)
00276 FSTRINGVAR(tEPRYMaxFeedrate)
00277 FSTRINGVAR(tEPRXHomingFeedrate)
00278 FSTRINGVAR(tEPRYHomingFeedrate)
00279 FSTRINGVAR(tEPRXAcceleration)
00280 FSTRINGVAR(tEPRYAcceleration)
00281 FSTRINGVAR(tEPRXTravelAcceleration)
00282 FSTRINGVAR(tEPRYTravelAcceleration)
00283 #else
00284 FSTRINGVAR(tEPRDiagonalRodLength)
00285 FSTRINGVAR(tEPRHorizontalRadius)
00286 FSTRINGVAR(tEPRSegmentsPerSecondPrint)
00287 FSTRINGVAR(tEPRSegmentsPerSecondTravel)
00288 FSTRINGVAR(tEPRTowerXOffset)
00289 FSTRINGVAR(tEPRTowerYOffset)
00290 FSTRINGVAR(tEPRTowerZOffset)
00291 #endif
00292 FSTRINGVAR(tEPROPSMode)
00293 FSTRINGVAR(tEPROPSMoveAfter)
00294 FSTRINGVAR(tEPROPSMinDistance)
00295 FSTRINGVAR(tEPROPSRetractionLength)
00296 FSTRINGVAR(tEPROPSRetractionBacklash)
00297 FSTRINGVAR(tEPRBedHeatManager)
00298 FSTRINGVAR(tEPRBedPIDDriveMax)
00299 FSTRINGVAR(tEPRBedPIDDriveMin)
00300 FSTRINGVAR(tEPRBedPGain)
00301 FSTRINGVAR(tEPRBedIGain)
00302 FSTRINGVAR(tEPRBedDGain)
00303 FSTRINGVAR(tEPRBedPISMaxValue)
00304 FSTRINGVAR(tEPRStepsPerMM)
00305 FSTRINGVAR(tEPRMaxFeedrate)
00306 FSTRINGVAR(tEPRStartFeedrate)
00307 FSTRINGVAR(tEPRAcceleration)
00308 FSTRINGVAR(tEPRHeatManager)
00309 FSTRINGVAR(tEPRDriveMax)
00310 FSTRINGVAR(tEPRDriveMin)
00311 FSTRINGVAR(tEPRPGain)
00312 FSTRINGVAR(tEPRIGain)
00313 FSTRINGVAR(tEPRDGain)
00314 FSTRINGVAR(tEPRPIDMaxValue)
00315 FSTRINGVAR(tEPRXOffset)
00316 FSTRINGVAR(tEPRYOffset)
00317 FSTRINGVAR(tEPRStabilizeTime)
00318 FSTRINGVAR(tEPRRetractionWhenHeating)
00319 FSTRINGVAR(tEPRDistanceRetractHeating)
00320 FSTRINGVAR(tEPRExtruderCoolerSpeed)
00321 FSTRINGVAR(tEPRAdvanceK)
00322 FSTRINGVAR(tEPRAdvanceL)
00323 #endif
00324 #if SDSUPPORT
00325 FSTRINGVAR(tSDRemoved)
00326 FSTRINGVAR(tSDInserted)
00327 FSTRINGVAR(tSDInitFail)
00328 FSTRINGVAR(tErrorWritingToFile)
00329 FSTRINGVAR(tBeginFileList)
00330 FSTRINGVAR(tEndFileList)
00331 FSTRINGVAR(tFileOpened)
00332 FSTRINGVAR(tSpaceSizeColon)
00333 FSTRINGVAR(tFileSelected)
00334 FSTRINGVAR(tFileOpenFailed)
00335 FSTRINGVAR(tSDPrintingByte)
00336 FSTRINGVAR(tNotSDPrinting)
00337 FSTRINGVAR(tOpenFailedFile)
00338 FSTRINGVAR(tWritingToFile)
00339 FSTRINGVAR(tDoneSavingFile)
00340 FSTRINGVAR(tFileDeleted)
00341 FSTRINGVAR(tDeletionFailed)
00342 FSTRINGVAR(tDirectoryCreated)
00343 FSTRINGVAR(tCreationFailed)
00344 FSTRINGVAR(tSDErrorCode)
00345 #endif // SDSUPPORT
00346 
00347 
00348 
00349 static void printNumber(unsigned long n);
00350 static void printWarningF(FSTRINGPARAM(text));
00351 static void printInfoF(FSTRINGPARAM(text));
00352 static void printErrorF(FSTRINGPARAM(text));
00353 static void printWarningFLN(FSTRINGPARAM(text));
00354 static void printInfoFLN(FSTRINGPARAM(text));
00355 static void printErrorFLN(FSTRINGPARAM(text));
00356 static void printFLN(FSTRINGPARAM(text));
00357 static void printF(FSTRINGPARAM(text));
00358 static void printF(FSTRINGPARAM(text),int value);
00359 static void printF(FSTRINGPARAM(text),const char *msg);
00360 static void printF(FSTRINGPARAM(text),long value);
00361 static void printF(FSTRINGPARAM(text),unsigned long value);
00362 static void printF(FSTRINGPARAM(text),float value,uint8_t digits=2);
00363 static void printFLN(FSTRINGPARAM(text),int value);
00364 static void printFLN(FSTRINGPARAM(text),long value);
00365 static void printFLN(FSTRINGPARAM(text),unsigned long value);
00366 static void printFLN(FSTRINGPARAM(text),const char *msg);
00367 static void printFLN(FSTRINGPARAM(text),float value,uint8_t digits=2);
00368 static void printArrayFLN(FSTRINGPARAM(text),float *arr,uint8_t n=4,uint8_t digits=2);
00369 static void printArrayFLN(FSTRINGPARAM(text),long *arr,uint8_t n=4);
00370 static void print(long value);
00371 static inline void print(unsigned long value) {printNumber(value);}
00372 static inline void print(int value) {print((long)value);}
00373 static void print(const char *text);
00374 static inline void print(char c) {HAL::serialWriteByte(c);}
00375 static void printFloat(float number, uint8_t digits);
00376 static inline void println() {HAL::serialWriteByte('\r');HAL::serialWriteByte('\n');}
00377     protected:
00378     private:
00379 };
00380 
00381 #endif // COMMUNICATION_H
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Defines