Forum Home › Forums › Development and Integration › jQuery issues in
- This topic has 12 replies, 2 voices, and was last updated 1 year, 5 months ago by
Mikhail.
-
AuthorPosts
-
March 23, 2024 at 9:50 am #14259
ipqiusheng
ParticipantIssues description:
in schememodel this javascript file, it define below property, but we can’t find RenderConext() functions in scheme namespace. does anybody find that?
this.renderContext = new scada.scheme.RenderContext();var scada = scada || {};
// Scheme namespace
scada.scheme = scada.scheme || {};/********** Base Component **********/
// Abstract parent type for scheme and its components
scada.scheme.BaseComponent = function (type) {
// Name of the component type
this.type = type;
// Component properties received from a server. They are different depending on component type
this.props = null;
// jQuery objects representing DOM content
this.dom = null;
// Renderer of the component
this.renderer = null;
};/********** Scheme Loading States **********/
// Scheme loading states enumeration
scada.scheme.LoadStates = {
UNDEFINED: 0,
DOC_LOADING: 1,
COMPONENTS_LOADING: 2,
IMAGES_LOADING: 3,
ERRORS_LOADING: 4,
COMPLETE: 5
};/********** Scheme **********/
// Scheme type
scada.scheme.Scheme = function () {
scada.scheme.BaseComponent.call(this);
this.renderer = new scada.scheme.SchemeRenderer();// Count of components received by a one request
this.LOAD_COMP_CNT = 100;
// Total data size of images received by a one request, 1 MB
this.LOAD_IMG_SIZE = 1048576;
// Timeout of command frame closing, ms
this.CLOSE_CMD_TIMEOUT = 1000;// Input channel filter for request current data
this._cnlFilter = null;// Indicates whether the scheme is used by an editor
this.editMode = false;
// Scheme environment
this.schemeEnv = null;
// Ajax queue used for request sequencing. Must be not null
this.ajaxQueue = scada.ajaxQueueLocator.getAjaxQueue();
// WCF-service URL
this.serviceUrl = this.ajaxQueue.rootPath + “plugins/Scheme/SchemeSvc.svc/”;
// Scheme loading state
this.loadState = scada.scheme.LoadStates.UNDEFINED;
// Scheme view ID
this.viewID = 0;
// Scheme editor ID
this.editorID = “”;
// Stamp of the view, unique within application scope
this.viewStamp = 0;
// Scheme components indexed by ID
this.componentMap = new Map();
// Scheme images indexed by name
this.imageMap = new Map();
// Scheme loading errors when it is loaded on server side
this.loadErrors = [];
// Render context
this.renderContext = new scada.scheme.RenderContext();March 23, 2024 at 11:58 am #14260ipqiusheng
Participantscada.scheme.UnknownComponentRenderer = function () {
scada.scheme.Renderer.call(this);
};scada.scheme.UnknownComponentRenderer.prototype = Object.create(scada.scheme.Renderer.prototype);
scada.scheme.UnknownComponentRenderer.constructor = scada.scheme.UnknownComponentRenderer;/********** Render Context **********/
// Render context type
scada.scheme.RenderContext = function () {
this.curCnlDataMap = null;
this.editMode = false;
this.schemeEnv = null;
this.viewID = 0;
this.imageMap = null;
this.controlRight = true;
};have find the defination in schemerender, mark here
March 24, 2024 at 11:19 am #14263ipqiusheng
Participanthi
All Guys
I meet some issues in schemerender.js file, it seems curCnlDataMap/imageMap are Map object, but I can’t find the inilization seems like imageMap=new map;
scada.scheme.RenderContext = function () {
this.curCnlDataMap = null;
this.editMode = false;
this.schemeEnv = null;
this.viewID = 0;
this.imageMap = null;
this.controlRight = true;
};March 25, 2024 at 11:19 am #14276April 7, 2024 at 12:55 am #14348ipqiusheng
Participantscada.scheme.SchemeRenderer.prototype._setTitle = function (title, renderContext) {
if (title && renderContext.schemeEnv.viewHub) {
document.title = title + ” – ” + renderContext.schemeEnv.viewHub.getEnv().productName;// set title of a popup in case the scheme is in the popup
var popup = scada.popupLocator.getPopup();
if (popup) {
popup.setModalTitle(window, document.title);
}// send notification about title change
renderContext.schemeEnv.viewHub.notify(scada.EventTypes.VIEW_TITLE_CHANGED, window, document.title);
}
};Hi
Mikhail, thank you for your kind comment, how about this popupLocator, it is under scada namespace, but I can’t find that defineApril 8, 2024 at 12:01 pm #14358Mikhail
ModeratorHi,
I cannot find the above lines in scheme-render.jsApril 8, 2024 at 12:21 pm #14360ipqiusheng
ParticipantHi
Mikhail
sorry, I haven’t use version 6.0, I still look at your version 5.0 code, your code is very elegant,I still look at that, this is version 5.0 code, the popupLocator existed in schemerender.js. not sure where it is defined, but it looks like define in viewhub.js, but I can’t find that.
https://github.com/RapidScada/scada/blob/master/ScadaWeb/ScadaScheme/PlgScheme/plugins/Scheme/js/schemerender.jsApril 8, 2024 at 12:23 pm #14362ipqiusheng
Participantalso, in basiccomprender.js, it also existed
April 8, 2024 at 12:26 pm #14365ipqiusheng
Participanthi
Mikhail
I put the link below my commentsApril 8, 2024 at 1:01 pm #14367ipqiusheng
Participantthanks for your reply
Mikhail, I have used github to find this popup.js in webshell project, so I can’t find that in plscheme files. just mark here for other guys if someone have interesting in your codeApril 9, 2024 at 11:26 am #14375Mikhail
ModeratorHi,
The popupLocator object is declared in popup.js, which is referenced by the web pages.April 16, 2024 at 5:59 am #14408ipqiusheng
ParticipantHi
Mikhail and other guys, do you know what’s parsedData define?, it has property of ViewStamp and SchemeDoc object?
scada.scheme.Scheme.prototype._obtainSchemeDoc = function (parsedData) {
try {
if (typeof parsedData.ViewStamp === “undefined”) {
throw { message: “ViewStamp property is missing.” };
}if (typeof parsedData.SchemeDoc === “undefined”) {
throw { message: “SchemeDoc property is missing.” };
}if (this._viewStampsMatched(this.viewStamp, parsedData.ViewStamp)) {
this.type = “”;
this.props = parsedData.SchemeDoc;
this.viewStamp = parsedData.ViewStamp;
return true;
} else {
return false;
}
}
catch (ex) {
console.error(scada.utils.getCurTime() + ” Error obtaining scheme properties:”, ex.message);
return false;
}
};April 16, 2024 at 12:51 pm #14416Mikhail
ModeratorHi,
You should open the development tools in Chrome by pressing F12, set a breakpoint and check the actual data in the debugger.ViewStamp is a stamp provided by server code to check that the client and server view data match.
SchemeDoc is a part of scheme object. -
AuthorPosts
- You must be logged in to reply to this topic.