-
Notifications
You must be signed in to change notification settings - Fork 291
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
#2917 Added Point locator test fields validation in Modbus IP #2919
Merged
Limraj
merged 16 commits into
release/2.7.8
from
feature/#2917_Added_Point_locator_test_fields_validation_in_Modbus_IP
Jul 2, 2024
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e063ca3
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 46e07bd
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 790358f
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 77ae878
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 5184d5f
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 05d7982
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 d8bcbd7
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 86b9e80
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 363b9c0
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 cbf1a8e
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 fa49be3
#2845 Fixed message validation in event search
Patrykb0802 7fd2396
Merge branch 'release/2.7.8' into feature/#2917_Added_Point_locator_t…
Limraj ab16263
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 e8865e7
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 6805506
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 d2ee637
#2917 Added Point locator test fields validation in Modbus IP
Patrykb0802 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,13 +56,77 @@ | |
DataSourceEditDwr.testModbusIpData($get("timeout"), $get("retries"), $get("transportType"), $get("host"), | ||
$get("port"), $get("encapsulated"), slaveId, range, offset, length, dataTestCB); | ||
} | ||
|
||
function validateModbusConfig(temp){ | ||
|
||
let messages = []; | ||
|
||
validateValue("updatePeriods", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.updatePeriods, messages); | ||
validateValue("updatePeriodType", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.updatePeriodType, messages); | ||
validateValue("timeout", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.timeout, messages); | ||
validateValue("retries", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.retries, messages); | ||
validateValue("maxReadBitCount", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.maxReadBitCount, messages); | ||
validateValue("maxReadRegisterCount", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.maxReadRegisterCount, messages); | ||
validateValue("maxWriteRegisterCount", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.maxWriteRegisterCount, messages); | ||
validateValue("port", "<fmt:message key='badIntegerFormat'/>", isPositiveInt, temp.port, messages); | ||
|
||
return messages; | ||
} | ||
|
||
function createModbusConfigTemp(){ | ||
let modbus = {}; | ||
modbus.dataSourceName = $get("dataSourceName"); | ||
modbus.dataSourceXid = $get("dataSourceXid"); | ||
modbus.updatePeriods = $get("updatePeriods"); | ||
modbus.updatePeriodType = $get("updatePeriodType"); | ||
modbus.quantize = $get("quantize"); | ||
modbus.timeout = $get("timeout"); | ||
modbus.retries = $get("retries"); | ||
modbus.contiguousBatches = $get("contiguousBatches"); | ||
modbus.createSlaveMonitorPoints = $get("createSlaveMonitorPoints"); | ||
modbus.maxReadBitCount = $get("maxReadBitCount"); | ||
modbus.maxReadRegisterCount = $get("maxReadRegisterCount"); | ||
modbus.maxWriteRegisterCount = $get("maxWriteRegisterCount"); | ||
modbus.transportType = $get("transportType"); | ||
modbus.host = $get("host"); | ||
modbus.port = $get("port"); | ||
modbus.encapsulated = $get("encapsulated"); | ||
modbus.createSocketMonitorPoint = $get("createSocketMonitorPoint"); | ||
|
||
return modbus; | ||
} | ||
|
||
function saveDataSourceImpl() { | ||
DataSourceEditDwr.saveModbusIpDataSource($get("dataSourceName"), $get("dataSourceXid"), $get("updatePeriods"), | ||
$get("updatePeriodType"), $get("quantize"), $get("timeout"), $get("retries"), $get("contiguousBatches"), | ||
$get("createSlaveMonitorPoints"), $get("maxReadBitCount"), $get("maxReadRegisterCount"), | ||
$get("maxWriteRegisterCount"), $get("transportType"), $get("host"), $get("port"), $get("encapsulated"), $get("createSocketMonitorPoint"), | ||
saveDataSourceCB); | ||
|
||
let temp = createModbusConfigTemp(); | ||
|
||
let messages = validateModbusConfig(temp); | ||
|
||
if(messages.length > 0) { | ||
stopImageFader("dsSaveImg"); | ||
showDwrMessages(messages); | ||
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. stopImageFader("dsSaveImg"); |
||
} else { | ||
let dataSourceName = temp.dataSourceName; | ||
let dataSourceXid = temp.dataSourceXid; | ||
let updatePeriods = parseInt(temp.updatePeriods); | ||
let updatePeriodType = parseInt(temp.updatePeriodType); | ||
let quantize = temp.quantize; | ||
let timeout = parseInt(temp.timeout); | ||
let retries = parseInt(temp.retries); | ||
let contiguousBatches = temp.contiguousBatches; | ||
let createSlaveMonitorPoints = temp.createSlaveMonitorPoints; | ||
let maxReadBitCount = parseInt(temp.maxReadBitCount); | ||
let maxReadRegisterCount = parseInt(temp.maxReadRegisterCount); | ||
let maxWriteRegisterCount = parseInt(temp.maxWriteRegisterCount); | ||
let transportType = temp.transportType; | ||
let host = temp.host; | ||
let port = parseInt(temp.port); | ||
let encapsulated = temp.encapsulated; | ||
let createSocketMonitorPoint = temp.createSocketMonitorPoint; | ||
DataSourceEditDwr.saveModbusIpDataSource(dataSourceName, dataSourceXid, updatePeriods, | ||
updatePeriodType, quantize, timeout, retries, contiguousBatches, createSlaveMonitorPoints, maxReadBitCount, maxReadRegisterCount, | ||
maxWriteRegisterCount, transportType, host, port, encapsulated, createSocketMonitorPoint, saveDataSourceCB); | ||
} | ||
} | ||
</script> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
stopImageFader("dsSaveImg");