Skip to content

Commit

Permalink
Merge pull request #2114 from SCADA-LTS/feature/#2101_Avoided_duplica…
Browse files Browse the repository at this point in the history
…te_values_2_6_13

Feature/#2101 avoided duplicate values 2 6 13
  • Loading branch information
Limraj authored Mar 3, 2022
2 parents 93f506b + 05ee3c5 commit b708b15
Show file tree
Hide file tree
Showing 25 changed files with 782 additions and 31 deletions.
12 changes: 10 additions & 2 deletions WebContent/WEB-INF/jsp/systemSettings.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@
$set("<c:out value="<%= SystemSettingsDAO.FUTURE_DATE_LIMIT_PERIOD_TYPE %>"/>", settings.<c:out value="<%= SystemSettingsDAO.FUTURE_DATE_LIMIT_PERIOD_TYPE %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.FUTURE_DATE_LIMIT_PERIODS %>"/>", settings.<c:out value="<%= SystemSettingsDAO.FUTURE_DATE_LIMIT_PERIODS %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.DATAPOINT_RUNTIME_VALUE_SYNCHRONIZED %>"/>", settings.<c:out value="<%= SystemSettingsDAO.DATAPOINT_RUNTIME_VALUE_SYNCHRONIZED %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.INSTANCE_DESCRIPTION %>"/>", settings.<c:out value="<%= SystemSettingsDAO.INSTANCE_DESCRIPTION %>"/>);
var sel = $("<c:out value="<%= SystemSettingsDAO.LANGUAGE %>"/>");
<c:forEach items="${availableLanguages}" var="lang">
sel.options[sel.options.length] = new Option("${lang.value}", "${lang.key}");
Expand Down Expand Up @@ -260,6 +261,7 @@
1,
$get("<c:out value="<%= SystemSettingsDAO.FUTURE_DATE_LIMIT_PERIOD_TYPE %>"/>"),
$get("<c:out value="<%= SystemSettingsDAO.FUTURE_DATE_LIMIT_PERIODS %>"/>"),
$get("<c:out value="<%= SystemSettingsDAO.DATAPOINT_RUNTIME_VALUE_SYNCHRONIZED %>"/>"),
function() {
stopImageFader("saveMiscSettingsImg");
setUserMessage("miscMessage", "<fmt:message key="systemSettings.miscSaved"/>");
Expand Down Expand Up @@ -715,6 +717,12 @@
</select>
</td>
</tr>
<tr>
<td class="formLabelRequired"><fmt:message key="systemsettings.misc.dataPointRuntimeValueSynchronized"/></td>
<td class="formField">
<input id="<c:out value="<%= SystemSettingsDAO.DATAPOINT_RUNTIME_VALUE_SYNCHRONIZED %>"/>" type="checkbox" class="formShort"/>
</td>
</tr>
<tr>
<td colspan="2" id="miscMessage" class="formError"></td>
</tr>
Expand Down
3 changes: 2 additions & 1 deletion scadalts-ui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,5 +445,6 @@
"watchdog.response.badRequest": "Check your request data!",
"watchdog.response.unauthorized": "You do not have permission to this action!",
"watchdog.response.unavailable": "Watchdog server is unreachable!",
"watchdog.response.unexpected": "Scada server error occurred!"
"watchdog.response.unexpected": "Scada server error occurred!",
"systemsettings.misc.dataPointRuntimeValueSynchronized": "Datapoint runtime value synchronized"
}
11 changes: 11 additions & 0 deletions scadalts-ui/src/views/SystemSettings/MiscSettingsComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@
dense
></v-select>
</v-col>
<v-col cols="6">
<v-checkbox
@change="watchDataChange()"
v-model="miscSettings.dataPointRuntimeValueSynchronized"
item-value="value"
item-text="text"
:label="$t('systemsettings.misc.dataPointRuntimeValueSynchronized')"
dense
></v-checkbox>
</v-col>
</v-row>
</v-card-text>
</v-card>
Expand Down Expand Up @@ -132,6 +142,7 @@ export default {
status: false,
message: '',
},
dataPointRuntimeValueSynchronized: false,
};
},
Expand Down
16 changes: 9 additions & 7 deletions src/com/serotonin/mango/rt/RuntimeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.concurrent.CopyOnWriteArrayList;

import com.serotonin.mango.db.dao.*;
import com.serotonin.mango.rt.dataImage.*;
import com.serotonin.mango.rt.event.*;
import com.serotonin.mango.rt.event.schedule.ResetDailyLimitSendingEventRT;
import com.serotonin.mango.rt.event.schedule.ScheduledExecuteInactiveEventRT;
Expand All @@ -48,11 +49,6 @@

import com.serotonin.ShouldNeverHappenException;
import com.serotonin.mango.Common;
import com.serotonin.mango.rt.dataImage.DataPointEventMulticaster;
import com.serotonin.mango.rt.dataImage.DataPointListener;
import com.serotonin.mango.rt.dataImage.DataPointRT;
import com.serotonin.mango.rt.dataImage.PointValueTime;
import com.serotonin.mango.rt.dataImage.SetPointSource;
import com.serotonin.mango.rt.dataImage.types.MangoValue;
import com.serotonin.mango.rt.dataSource.DataSourceRT;
import com.serotonin.mango.rt.dataSource.meta.MetaDataSourceRT;
Expand Down Expand Up @@ -472,8 +468,7 @@ private void startDataPoint(DataPointVO vo) {
DataSourceRT ds = getRunningDataSource(vo.getDataSourceId());
if (ds != null) {
// Change the VO into a data point implementation.
DataPointRT dataPoint = new DataPointRT(vo, vo
.getPointLocator().createRuntime());
DataPointRT dataPoint = createDataPointRT(vo);

// Add/update it in the data image.
dataPoints.put(dataPoint.getId(), dataPoint);
Expand All @@ -490,6 +485,13 @@ private void startDataPoint(DataPointVO vo) {
}
}

public static DataPointRT createDataPointRT(DataPointVO vo) {
boolean dataPointRtSynchronized = new SystemSettingsService().isDataPointRtValueSynchronized();
if(dataPointRtSynchronized)
return new DataPointSynchronizedRT(vo, vo.getPointLocator().createRuntime());
return new DataPointRT(vo, vo.getPointLocator().createRuntime());
}

private void startDataPointSafe(DataPointVO vo) {
try {
startDataPoint(vo);
Expand Down
Loading

0 comments on commit b708b15

Please sign in to comment.