Compare commits
4 Commits
exploring_
...
SINQSW-107
Author | SHA1 | Date | |
---|---|---|---|
d44dbaaf0f | |||
501c5badea | |||
39098fd0d1 | |||
1539bfc66a |
246
.clang-format
Normal file
246
.clang-format
Normal file
@ -0,0 +1,246 @@
|
||||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignArrayOfStructures: None
|
||||
AlignConsecutiveAssignments:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: true
|
||||
AlignConsecutiveBitFields:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveDeclarations:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveMacros:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveShortCaseStatements:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCaseColons: false
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: Align
|
||||
AlignTrailingComments:
|
||||
Kind: Always
|
||||
OverEmptyLines: 0
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowBreakBeforeNoexceptSpecifier: Never
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortCompoundRequirementOnASingleLine: true
|
||||
AllowShortEnumsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
AttributeMacros:
|
||||
- __capability
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BitFieldColonSpacing: Both
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: false
|
||||
AfterControlStatement: Never
|
||||
AfterEnum: false
|
||||
AfterExternBlock: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
BreakAdjacentStringLiterals: true
|
||||
BreakAfterAttributes: Leave
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakArrays: true
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeConceptDeclarations: Always
|
||||
BreakBeforeBraces: Attach
|
||||
BreakBeforeInlineASMColon: OnlyMultiline
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 80
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
EmptyLineAfterAccessModifier: Never
|
||||
EmptyLineBeforeAccessModifier: LogicalBlock
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
FixNamespaceComments: true
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IfMacros:
|
||||
- KJ_IF_MAYBE
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IncludeIsMainSourceRegex: ''
|
||||
IndentAccessModifiers: false
|
||||
IndentCaseBlocks: false
|
||||
IndentCaseLabels: false
|
||||
IndentExternBlock: AfterExternBlock
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentRequiresClause: true
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
InsertBraces: false
|
||||
InsertNewlineAtEOF: false
|
||||
InsertTrailingCommas: None
|
||||
IntegerLiteralSeparator:
|
||||
Binary: 0
|
||||
BinaryMinDigits: 0
|
||||
Decimal: 0
|
||||
DecimalMinDigits: 0
|
||||
Hex: 0
|
||||
HexMinDigits: 0
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
KeepEmptyLinesAtEOF: false
|
||||
LambdaBodyIndentation: Signature
|
||||
LineEnding: DeriveLF
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ObjCBinPackProtocolList: Auto
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCBreakBeforeNestedBlockParam: true
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PackConstructorInitializers: BinPack
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakOpenParenthesis: 0
|
||||
PenaltyBreakScopeResolution: 500
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyIndentedWhitespace: 0
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Right
|
||||
PPIndentWidth: -1
|
||||
QualifierAlignment: Leave
|
||||
ReferenceAlignment: Pointer
|
||||
ReflowComments: true
|
||||
RemoveBracesLLVM: false
|
||||
RemoveParentheses: Leave
|
||||
RemoveSemicolon: false
|
||||
RequiresClausePosition: OwnLine
|
||||
RequiresExpressionIndentation: OuterScope
|
||||
SeparateDefinitionBlocks: Leave
|
||||
ShortNamespaceLines: 1
|
||||
SkipMacroDefinitionBody: false
|
||||
SortIncludes: CaseSensitive
|
||||
SortJavaStaticImport: Before
|
||||
SortUsingDeclarations: LexicographicNumeric
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceAroundPointerQualifiers: Default
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeJsonColon: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeParensOptions:
|
||||
AfterControlStatements: true
|
||||
AfterForeachMacros: true
|
||||
AfterFunctionDefinitionName: false
|
||||
AfterFunctionDeclarationName: false
|
||||
AfterIfMacros: true
|
||||
AfterOverloadedOperator: false
|
||||
AfterPlacementOperator: true
|
||||
AfterRequiresInClause: false
|
||||
AfterRequiresInExpression: false
|
||||
BeforeNonEmptyParentheses: false
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceBeforeSquareBrackets: false
|
||||
SpaceInEmptyBlock: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: Never
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInLineCommentPrefix:
|
||||
Minimum: 1
|
||||
Maximum: -1
|
||||
SpacesInParens: Never
|
||||
SpacesInParensOptions:
|
||||
InCStyleCasts: false
|
||||
InConditionalStatements: false
|
||||
InEmptyParentheses: false
|
||||
Other: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Latest
|
||||
StatementAttributeLikeMacros:
|
||||
- Q_EMIT
|
||||
StatementMacros:
|
||||
- Q_UNUSED
|
||||
- QT_REQUIRE_VERSION
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
VerilogBreakBetweenInstancePorts: true
|
||||
WhitespaceSensitiveMacros:
|
||||
- BOOST_PP_STRINGIZE
|
||||
- CF_SWIFT_NAME
|
||||
- NS_SWIFT_NAME
|
||||
- PP_STRINGIZE
|
||||
- STRINGIZE
|
||||
...
|
||||
|
@ -36,7 +36,6 @@ SOURCES += sinqEPICSApp/src/pmacAsynIPPort.c
|
||||
SOURCES += sinqEPICSApp/src/pmacAxis.cpp
|
||||
SOURCES += sinqEPICSApp/src/pmacController.cpp
|
||||
SOURCES += sinqEPICSApp/src/MasterMACSDriver.cpp
|
||||
SOURCES += sinqEPICSApp/src/pollerRegister.cpp
|
||||
|
||||
USR_CFLAGS += -Wall -Wextra # -Werror
|
||||
|
||||
|
@ -38,3 +38,12 @@ Those political problems require a special development model:
|
||||
Take care of the sinqEPICsApp/src/sinq.dbd file. This is the one which differs mostly between
|
||||
amorsim and master branches.
|
||||
|
||||
# Formatting
|
||||
|
||||
Formatting is done via the [`.clang-format`](./.clang-format) file checked into
|
||||
the repository. One option to apply the formatting to a given file is via the
|
||||
command below.
|
||||
|
||||
```
|
||||
clang-format -i -style=file <file>
|
||||
```
|
||||
|
@ -50,14 +50,5 @@ record(longin, "$(P)$(M):Enable_RBV") {
|
||||
record(longout, "$(P)$(M):Reread_Encoder") {
|
||||
field(DTYP, "asynInt32")
|
||||
field(OUT, "@asyn($(PORT),$(N),1) REREAD_ENCODER_POSITION")
|
||||
field(PINI, "YES")
|
||||
}
|
||||
|
||||
# reread encoder
|
||||
record(longin, "$(P)$(M):Reread_Encoder_RBV") {
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn($(PORT),$(N),1) REREAD_ENCODER_POSITION_RBV")
|
||||
field(PINI, "NO")
|
||||
field(SCAN, "1 second")
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,21 @@
|
||||
|
||||
record(bo,"$(P):Pause")
|
||||
{
|
||||
field(DTYP,"Soft Channel")
|
||||
field(DTYP,"Soft Channel")
|
||||
}
|
||||
|
||||
record(longin,"$(P):Status")
|
||||
{
|
||||
field(DTYP,"Soft Channel")
|
||||
field(DTYP,"Soft Channel")
|
||||
}
|
||||
|
||||
record(stringin,"$(P):MsgTxt")
|
||||
{
|
||||
field(DTYP,"Soft Channel")
|
||||
field(DTYP,"Soft Channel")
|
||||
}
|
||||
|
||||
record(scaler,"$(P)")
|
||||
{
|
||||
field(DESC,"$(DESC)")
|
||||
field(DTYP,"asynScalerEL737")
|
||||
field(OUT,"INST_IO @asyn($(PORT),0)")
|
||||
field(DESC,"$(DESC)")
|
||||
field(DTYP,"asynScalerEL737")
|
||||
field(OUT,"INST_IO @asyn($(PORT),0)")
|
||||
}
|
||||
|
@ -916,7 +916,6 @@ asynStatus pmacV3Axis::poll(bool *moving) {
|
||||
sprintf(message, "%s: Polling axis: %d", functionName, this->axisNo_);
|
||||
pC_->debugFlow(message);
|
||||
|
||||
|
||||
// Now poll axis status
|
||||
if ((status = this->getAxisStatus(moving)) != asynSuccess) {
|
||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR,
|
||||
@ -925,10 +924,6 @@ asynStatus pmacV3Axis::poll(bool *moving) {
|
||||
functionName, pC_->portName, axisNo_);
|
||||
}
|
||||
|
||||
double motorRecResolution_ = 0.;
|
||||
pC_->getDoubleParam(this->axisNo_, pC_->motorRecResolution_, &motorRecResolution_);
|
||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, "%s: Polling %f\n", functionName, motorRecResolution_);
|
||||
|
||||
callParamCallbacks();
|
||||
return status;
|
||||
|
||||
|
@ -45,7 +45,6 @@ using std::endl;
|
||||
|
||||
#include "pmacController.h"
|
||||
#include "pmacAxis.h"
|
||||
#include "pollerRegister.h"
|
||||
|
||||
#define MULT 1000.
|
||||
|
||||
@ -143,7 +142,6 @@ asynStatus pmacCreateAxis(const char *pmacName, int numAxis);
|
||||
|
||||
}
|
||||
|
||||
|
||||
pmacController::pmacController(const char *portName, const char *lowLevelPortName, int lowLevelPortAddress,
|
||||
int numAxes, double movingPollPeriod, double idlePollPeriod, const int& extraParams)
|
||||
: SINQController(portName, lowLevelPortName, numAxes+1, extraParams)
|
||||
@ -168,31 +166,7 @@ setIntegerParam(PMAC_C_CommsError_, 1);
|
||||
* NOTE: at this point the axis objects don't yet exist, but the poller tolerates this */
|
||||
setIntegerParam(PMAC_C_CommsError_, 0);
|
||||
}
|
||||
|
||||
registerFunction(
|
||||
[this](){
|
||||
//startPoller(movingPollPeriod, idlePollPeriod, 0);
|
||||
//
|
||||
|
||||
asynPrint(
|
||||
this->pasynUserSelf,
|
||||
ASYN_TRACE_ERROR,
|
||||
"\n\n\n%s: status %d %d %d %d %d %d\n\n\n",
|
||||
functionName,
|
||||
asynSuccess,asynTimeout,asynOverflow,asynError,asynDisconnected,asynDisabled);
|
||||
|
||||
double motorRecResolution_ = 0.;
|
||||
asynStatus status = this->getDoubleParam(1, this->motorRecResolution_, &motorRecResolution_);
|
||||
asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR, "\n\n\n%s: Polling %f, status %d\n\n\n", functionName, motorRecResolution_, status);
|
||||
|
||||
usleep(50000); // slow down communication somewhat
|
||||
|
||||
status = this->getDoubleParam(1, this->motorRecResolution_, &motorRecResolution_);
|
||||
asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR, "\n\n\n%s: Polling %f, status %d\n\n\n", functionName, motorRecResolution_, status);
|
||||
}
|
||||
);
|
||||
|
||||
startPoller(movingPollPeriod, idlePollPeriod, 0);
|
||||
startPoller(movingPollPeriod, idlePollPeriod, 10);
|
||||
|
||||
callParamCallbacks();
|
||||
|
||||
@ -528,8 +502,6 @@ asynStatus pmacController::poll()
|
||||
|
||||
debugFlow(functionName);
|
||||
|
||||
asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR, "%s: Polling\n", functionName);
|
||||
|
||||
if (!lowLevelPortUser_) {
|
||||
setIntegerParam(this->motorStatusCommsError_, 1);
|
||||
return asynError;
|
||||
|
@ -41,6 +41,7 @@ class pmacController : public SINQController {
|
||||
pmacAxis* getAxis(int axisNo);
|
||||
asynStatus poll();
|
||||
|
||||
|
||||
protected:
|
||||
pmacAxis **pAxes_; /**< Array of pointers to axis objects */
|
||||
|
||||
|
@ -1,96 +0,0 @@
|
||||
#include "pollerRegister.h"
|
||||
|
||||
#include <vector>
|
||||
#include <cstdio>
|
||||
|
||||
#include "libComAPI.h"
|
||||
#include "initHooks.h"
|
||||
|
||||
static std::vector<std::function<void()>> registeredFunctions;
|
||||
|
||||
static void startPollingHook(initHookState state) {
|
||||
switch (state) {
|
||||
case initHookAtIocBuild:
|
||||
printf("\n\n\ninitHookAtIocBuild\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAtBeginning:
|
||||
printf("\n\n\ninitHookAtBeginning\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterCallbackInit:
|
||||
printf("\n\n\ninitHookAfterCallbackInit\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterCaLinkInit:
|
||||
printf("\n\n\ninitHookAfterCaLinkInit\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterInitDrvSup:
|
||||
printf("\n\n\ninitHookAfterInitDrvSup\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterInitRecSup:
|
||||
printf("\n\n\ninitHookAfterInitRecSup\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterInitDevSup:
|
||||
printf("\n\n\ninitHookAfterInitDevSup\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterInitDatabase:
|
||||
printf("\n\n\ninitHookAfterInitDatabase\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterFinishDevSup:
|
||||
printf("\n\n\ninitHookAfterFinishDevSup\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterScanInit:
|
||||
printf("\n\n\ninitHookAfterScanInit\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterInitialProcess:
|
||||
printf("\n\n\ninitHookAfterInitialProcess\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterCaServerInit:
|
||||
printf("\n\n\ninitHookAfterCaServerInit\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterIocBuilt:
|
||||
printf("\n\n\ninitHookAfterIocBuilt\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAtIocRun:
|
||||
printf("\n\n\ninitHookAtIocRun\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterDatabaseRunning:
|
||||
printf("\n\n\ninitHookAfterDatabaseRunning\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAtEnd:
|
||||
printf("\n\n\ninitHookAtEnd\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterCaServerRunning:
|
||||
printf("\n\n\ninitHookAfterCaServerRunning\n\n\n");
|
||||
break;
|
||||
|
||||
case initHookAfterIocRunning:
|
||||
printf("\n\n\ninitHookAfterIocRunning\n\n\n");
|
||||
for(auto&& fn : registeredFunctions)
|
||||
fn();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int myHookStatus = initHookRegister(startPollingHook);
|
||||
|
||||
void registerFunction(std::function<void()> func) {
|
||||
registeredFunctions.push_back(func);
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
#ifndef POLLERREGISTER
|
||||
#define POLLERREGISTER
|
||||
|
||||
#include <functional>
|
||||
|
||||
void registerFunction(std::function<void()> func);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user