-
Notifications
You must be signed in to change notification settings - Fork 1
Fix/window handling #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v1
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -506,7 +506,7 @@ void PositionController::setPositionLowerLimit(uint8_t positionLimit, bool moveT | |
| } | ||
| else if (targetPosition() > positionLimit || moveToLimit) | ||
| { | ||
| _blockedPosition = targetPosition(); | ||
| if (_blockedPosition == NOTUSED) _blockedPosition = targetPosition(); | ||
| _calculatedTargetPosition = positionLimit; | ||
| _setPosition = positionLimit; | ||
| logDebugP("Position limit forces new position %d, store %d", (int)_setPosition, (int)_blockedPosition); | ||
|
|
@@ -542,7 +542,7 @@ void PositionController::setSlatLowerLimit(uint8_t slatLimit, bool moveToLimit) | |
| } | ||
| else if (slat() > slatLimit || moveToLimit) | ||
| { | ||
| _blockedSlat = slat(); | ||
| if (_blockedSlat == NOTUSED) _blockedSlat = slat(); | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gleiches wie oben, nur für die Lamellen. |
||
| _setSlat = slatLimit; | ||
| logDebugP("Slat limit forces new slat %d, store %d", (int)_setSlat, (int)_blockedSlat); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,7 +61,7 @@ void ShutterControllerChannel::setup() | |
| _modeManual = new ModeManual(*this); | ||
| for (uint8_t i = 1; i <= ParamSHC_CWindowOpenCount; i++) | ||
| { | ||
| _windowOpenHandlers.push_back(new WindowOpenHandler(_channelIndex, i, ParamSHC_CWindowOpenCount != i)); | ||
| _windowOpenHandlers.push_back(new WindowOpenHandler(_channelIndex, i, i == 2)); // ParamSHC_CWindowOpenCount != i)); | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eine der notwendigen Änderungen, damit die KO-Verwechslung gelöst wird. Mir ist aber nicht klar, warum das so funktioniert. |
||
| } | ||
|
|
||
| _modes.push_back(_modeManual); | ||
|
|
@@ -411,10 +411,12 @@ void ShutterControllerChannel::execute(CallContext &callContext) | |
| if (nextWindowOpenHandler != nullptr) | ||
| logInfoP("Start window open %s", nextWindowOpenHandler->name()); | ||
| else | ||
| { | ||
| logInfoP("Stop window open"); | ||
| if (_currentWindowOpenHandler != nullptr) | ||
| _currentWindowOpenHandler->stop(callContext, nextWindowOpenHandler, _positionController); | ||
| } | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dieses darf nur beim Stop ausgeführt werden, damit wechsel zwischen offen und kipp nicht zum erneuten speichern der _blockedPosition führen. |
||
| } | ||
| if (_currentWindowOpenHandler != nullptr) | ||
| _currentWindowOpenHandler->stop(callContext, nextWindowOpenHandler, _positionController); | ||
| _currentWindowOpenHandler = nextWindowOpenHandler; | ||
| if (_currentWindowOpenHandler != nullptr) | ||
| _currentWindowOpenHandler->start(callContext, _currentWindowOpenHandler, _positionController); | ||
|
|
@@ -466,7 +468,7 @@ void ShutterControllerChannel::execute(CallContext &callContext) | |
| } | ||
| logIndentDown(); | ||
| } | ||
| if (_currentMode != nextMode) | ||
| if (_currentMode != nextMode && nextMode != nullptr) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Das verhindert den Hänger bei einer Sperre, aber ich weiß nicht, ob man einfach so das if überspringen darf. Das musst Du entscheiden und "richtig" machen. |
||
| { | ||
| sceneChanged = true; | ||
| if (nextMode == _modeManual) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,29 @@ | |
| <Manufacturer> | ||
| <ApplicationPrograms> | ||
| <ApplicationProgram> | ||
| <op:part href="ShutterControllerModule.ModeShading.xml" name="ModeShading" instances="2"> | ||
| <!-- Parameter Offset --> | ||
| <op:param name="%ParamOffset%" value="39" increment="38" /> | ||
| <!-- KO Offset--> | ||
| <op:param name="%En%" value="35" increment="7" /> | ||
| <!-- ModeShading number --> | ||
| <op:param name="%Pn%" value="1" /> | ||
| <!-- Parameter ID's --> | ||
| <op:param name="%PPP%" value="100" increment="100" /> | ||
| <!-- Min Temp--> | ||
| <op:param name="%MinTemp%" value="15" increment="5" /> | ||
| </op:part> | ||
|
|
||
| <Static> | ||
| <ParameterTypes> | ||
| <!-- Number of channels (module specific) --> | ||
| <ParameterType Id="%AID%_PT-NumberOfShading" Name="NumberOfShading"> | ||
| <TypeRestriction Base="Value" SizeInBit="4"> | ||
| <Enumeration Text="Keine" Value="0" Id="%ENID%" /> | ||
| <!-- ShutterControllerModule.ModeShading.xml will be included here --> | ||
| <op:usePart name="ModeShading" xpath="//ParameterTypes/ParameterType[@Name='NumberOfShadingEnumValue']/TypeRestriction/*" /> | ||
| </TypeRestriction> | ||
| </ParameterType> | ||
| <ParameterType Id="%AID%_PT-SHCNumChannels" Name="SHCNumChannels"> | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dieser Change war schon in meinem PR #4 drin, weiß nicht, warum das nochmal drin steht |
||
| <TypeNumber SizeInBit="8" Type="unsignedInt" minInclusive="0" maxInclusive="%N%" /> | ||
| </ParameterType> | ||
|
|
@@ -552,7 +572,7 @@ | |
| </ComObjectRefs> | ||
| </Static> | ||
| <Dynamic> | ||
| <Channel Name="MainChannel%TT%" Text="Jalousiensteuerung" Number="%TT%" Id="%AID%_CH-%TT%" Icon="blinds-horizontal"> | ||
| <Channel Id="%AID%_CH-%PREFIX%" Number="%PREFIX%" Name="ShutterControl" Text="Jalousiensteuerung" Icon="blinds-horizontal"> | ||
|
|
||
| <ParameterBlock Id="%AID%_PB-nnn" Name="Settings%TT%" Text="Allgemein" Icon="cog-outline" HelpContext="SHC-Allgemein" ShowInComObjectTree="true"> | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ebenso schon im PR #4 |
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,30 +19,7 @@ | |
| <op:param name="%PPP%" value="900" increment="10" /> | ||
| </op:part> | ||
|
|
||
| <op:part href="ShutterControllerModule.ModeShading.xml" name="ModeShading" instances="2"> | ||
| <!-- Parameter Offset --> | ||
| <op:param name="%ParamOffset%" value="39" increment="38" /> | ||
| <!-- KO Offset--> | ||
| <op:param name="%En%" value="35" increment="7" /> | ||
| <!-- ModeShading number --> | ||
| <op:param name="%Pn%" value="1" /> | ||
| <!-- Parameter ID's --> | ||
| <op:param name="%PPP%" value="100" increment="100" /> | ||
| <!-- Min Temp--> | ||
| <op:param name="%MinTemp%" value="15" increment="5" /> | ||
| </op:part> | ||
|
|
||
| <Static> | ||
| <ParameterTypes> | ||
| <ParameterType Id="%AID%_PT-NumberOfShading" Name="NumberOfShading"> | ||
| <TypeRestriction Base="Value" SizeInBit="4"> | ||
| <Enumeration Text="Keine" Value="0" Id="%ENID%" /> | ||
| <!-- ShutterControllerModule.ModeShading.xml will be included here --> | ||
| <op:usePart name="ModeShading" xpath="//ParameterTypes/ParameterType[@Name='NumberOfShadingEnumValue']/TypeRestriction/*" /> | ||
|
|
||
| </TypeRestriction> | ||
| </ParameterType> | ||
| </ParameterTypes> | ||
| <Parameters> | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ebenso in PR #4 |
||
|
|
||
| <!-- Kanal Name --> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,15 +6,15 @@ | |
| #ifdef SHC_CWindowOpenPosition2 | ||
| // redefine SHC_ParamCalcIndex to add offset for Window Mode 2 | ||
| #undef SHC_ParamCalcIndex | ||
| #define SHC_ParamCalcIndex(index) (index + SHC_ParamBlockOffset + _channelIndex * SHC_ParamBlockSize + (SHC_CWindowOpenPosition2 - SHC_CWindowOpenPosition1) * (_index - 1)) | ||
| #define SHC_ParamCalcIndex(index) (index + SHC_ParamBlockOffset + _channelIndex * SHC_ParamBlockSize + (SHC_CWindowOpenPosition2 - SHC_CWindowOpenPosition1) * (1 - _isTiltHandler)) | ||
|
|
||
| // redefine SHC_KoCalcNumber to add offset for Window Mode 2 | ||
| #undef SHC_KoCalcNumber | ||
| #define SHC_KoCalcNumber(index) (index + SHC_KoBlockOffset + _channelIndex * SHC_KoBlockSize + (_index - 1) * (SHC_KoCWindowOpenModeActive2 - SHC_KoCWindowOpenModeActive1)) | ||
| #define SHC_KoCalcNumber(index) (index + SHC_KoBlockOffset + _channelIndex * SHC_KoBlockSize + (_isTiltHandler) * (SHC_KoCWindowOpenModeActive2 - SHC_KoCWindowOpenModeActive1)) | ||
|
|
||
| // redefine SHC_KoCalcIndex to add offset for Window Mode 2 | ||
| #undef SHC_KoCalcIndex | ||
| #define SHC_KoCalcIndex(number) ((number >= SHC_KoCalcNumber(0) && number < SHC_KoCalcNumber(SHC_KoBlockSize)) ? (number - SHC_KoBlockOffset - (_index - 1) * (SHC_KoCWindowOpenModeActive2 - SHC_KoCWindowOpenModeActive1)) % SHC_KoBlockSize : -1) | ||
| #define SHC_KoCalcIndex(number) ((number >= SHC_KoCalcNumber(0) && number < SHC_KoCalcNumber(SHC_KoBlockSize)) ? (number - SHC_KoBlockOffset - (_isTiltHandler) * (SHC_KoCWindowOpenModeActive2 - SHC_KoCWindowOpenModeActive1)) % SHC_KoBlockSize : -1) | ||
|
|
||
| #endif | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Die 3 Macros musste ich anpassen, damit die Verwechslung der KO (offen <-> kipp) rückgängig gemacht wurde. Aber ich verstehe nicht, warum das nötig war und bin mir auch nicht sicher, dass ich schon alle Fälle durchgetestet habe. Hier muss der Fachmann ran, um es richtig zu machen. |
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hier wird die Position nur noch gespeichert, wenn man das Fenster erstmals öffnet oder kippt, nicht bei jedem Wechsel.