Skip to content

Commit

Permalink
Fixed last entry is not always record ID 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Stricker committed Oct 28, 2020
1 parent 648980b commit 91d41a6
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 84 deletions.
1 change: 1 addition & 0 deletions Logical/mappLogbook/LogTypes.typ
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ TYPE
enumDetails3,
enumDetails4,
enumFilter,
enumPrep,
enumError
);
enumSeverity :
Expand Down
24 changes: 19 additions & 5 deletions Logical/mappLogbook/Logbook/Main.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ END_PROGRAM
PROGRAM _CYCLIC
// Abort current update run
IF EDGENEG(gLogbook.CMD.Refresh) THEN
state := enumWait;
IF state <> enumError THEN
state := enumWait;
END_IF
END_IF
// Run task multiple times to speed up process
FOR executions:=1 TO LOGBOOK_EXECUTIONS DO
Expand Down Expand Up @@ -120,11 +122,18 @@ PROGRAM _CYCLIC
IF ArEventLogGetPreviousRecordID_0.Done AND ArEventLogGetPreviousRecordID_0.StatusID = ERR_OK THEN
Facility.RecordID[Facility.CntFacility] := ArEventLogGetPreviousRecordID_0.PrevRecordID;
state := enumDetails1;
// Error
// Error
ELSIF ArEventLogGetPreviousRecordID_0.Error THEN
gLogbook.ERR.State := state;
gLogbook.Status := ArEventLogGetPreviousRecordID_0.StatusID;
state := enumError;
// Last entry reached is no error
IF ArEventLogGetPreviousRecordID_0.StatusID = arEVENTLOG_ERR_RECORDID_INVALID THEN
Facility.RecordID[Facility.CntFacility] := 1;
state := enumPrep;
// Everything else is an error
ELSE
gLogbook.ERR.State := state;
gLogbook.Status := ArEventLogGetPreviousRecordID_0.StatusID;
state := enumError;
END_IF
END_IF
// --------------------------------------------------------------------------------------------------------------------
// Read event id and time stamp
Expand Down Expand Up @@ -331,7 +340,12 @@ PROGRAM _CYCLIC
ArEventLogReadErrorNumber_0(Execute := FALSE);
ArEventLogReadDescription_0(Execute := FALSE);
ArEventLogReadAddData_0(Execute := FALSE);
state := enumPrep;

// --------------------------------------------------------------------------------------------------------------------
// Perpare for next entry
// --------------------------------------------------------------------------------------------------------------------
enumPrep:
// Find next facility from here to the end
REPEAT
Facility.CntFacility := Facility.CntFacility + 1;
Expand Down
5 changes: 4 additions & 1 deletion Logical/mappLogbook/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
Next Version
Version 0.2
- Fixed special characters not showing up correct
- Fixed filter checkboxes dont remember state
- Fixed last entry is not always record ID 1
- Option to stop searching when entry limit is reached
- Option to abort current update run
- Smaller bug fixes

Version 0.1
- First public release
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</Widget>
<Widget xsi:type="widgets.brease.ToggleButton" id="btnRefresh" top="720" left="20" width="160" height="70" zIndex="0" mouseDownText="Abort" text="Refresh" cornerRadius="5px" fontSize="26px" />
<Widget xsi:type="widgets.brease.Button" id="btnResetError" top="720" left="210" width="160" height="70" zIndex="1" text="Reset Error" cornerRadius="5px" />
<Widget xsi:type="widgets.brease.NumericOutput" id="numStatus" top="770" left="270" height="20" zIndex="2" format="{'metric':{'decimalPlaces':0,'minimumIntegerDigits':1,'maximumIntegerDigits':10},'imperial':{'decimalPlaces':0,'minimumIntegerDigits':1,'maximumIntegerDigits':10},'imperial-us':{'decimalPlaces':0,'minimumIntegerDigits':1,'maximumIntegerDigits':10}}" borderWidth="1px" borderStyle="none" textAlign="left" padding="0px 0px 0px 0px" />
<Widget xsi:type="widgets.brease.NumericOutput" id="numStatus" top="770" left="255" width="115" height="20" zIndex="2" format="{'metric':{'decimalPlaces':0,'minimumIntegerDigits':1,'maximumIntegerDigits':10},'imperial':{'decimalPlaces':0,'minimumIntegerDigits':1,'maximumIntegerDigits':10},'imperial-us':{'decimalPlaces':0,'minimumIntegerDigits':1,'maximumIntegerDigits':10}}" borderWidth="1px" borderStyle="none" textAlign="left" padding="0px 0px 0px 0px" />
<Widget xsi:type="widgets.brease.Label" id="Label1" top="770" left="210" width="60" height="20" zIndex="3" text="Status" />
<Widget xsi:type="widgets.brease.Label" id="Label4" top="20" left="9" width="81" height="20" zIndex="310" text="Error No" textAlign="right" bold="true" />
<Widget xsi:type="widgets.brease.NumericInput" id="numFilterErrorNo" top="15" left="95" width="131" zIndex="311" format="{'metric':{'decimalPlaces':0,'minimumIntegerDigits':1},'imperial':{'decimalPlaces':1,'minimumIntegerDigits':1},'imperial-us':{'decimalPlaces':1,'minimumIntegerDigits':1}}" maxValue="10000000000" useDigitGrouping="false" padding="0px 5px 0px 5px" />
Expand Down
154 changes: 77 additions & 77 deletions Physical/PC/X20CP1583/mappView/Logbook.binding
Original file line number Diff line number Diff line change
Expand Up @@ -137,81 +137,81 @@
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.AbortOnEntriesLimit" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkStopMaxEntries" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.CMD.Refresh" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="btnRefresh" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[0]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterAccSec" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[1]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterCommissioning" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[2]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterConnectivity" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[3]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterFieldbus" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[4]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterFirewall" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[5]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterMapp" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[6]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterMotion" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[7]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterSafety" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[8]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterSystem" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[9]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterTextSystem" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[10]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterUnitSystem" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[11]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterUser" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[12]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterVision" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[13]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterVisualization" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterSeverity[3]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterError" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterSeverity[2]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterWarning" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterSeverity[1]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterInformation" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterSeverity[0]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterNotification" attribute="value" />
</Binding>
</Bindings>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.CMD.Refresh" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="btnRefresh" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[0]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterAccSec" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[1]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterCommissioning" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[2]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterConnectivity" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[3]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterFieldbus" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[4]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterFirewall" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[5]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterMapp" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[6]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterMotion" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[7]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterSafety" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[8]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterSystem" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[9]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterTextSystem" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[10]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterUnitSystem" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[11]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterUser" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[12]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterVision" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterFacility[13]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterVisualization" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterSeverity[3]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterError" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterSeverity[2]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterWarning" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterSeverity[1]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterInformation" attribute="value" />
</Binding>
<Binding mode="twoWay">
<Source xsi:type="opcUa" refId="::AsGlobalPV:gLogbook.PAR.FilterSeverity[0]" attribute="value" />
<Target xsi:type="brease" contentRefId="contentLogbook" widgetRefId="chkFilterNotification" attribute="value" />
</Binding>
</Bindings>
</BindingsSet>

0 comments on commit 91d41a6

Please sign in to comment.