639 lines
21 KiB
Plaintext
639 lines
21 KiB
Plaintext
<?xml version='1.0' encoding='utf-8'?>
|
|
<graph version="1.0" author="hmi">
|
|
<head frequence="-1" alias="" plane_num="3" back_color="-16372926" init_plane_show="0," station_app="PSCADA.station" level_num="1" wnd_modal="2" graph_type="0" topo="0" enable_scale="0" show_mode="0" web="1" wnd_flags="0" backpixmap="index_background.png" rect="250,69,1670,54" wnd_title=""/>
|
|
<body style="">
|
|
<plane plane_name="0" count="10">
|
|
<item checked="0" taginfo0="" ocx_name="" show_plane="" show_only="1" name="m_pre" transform="1,1" obj_type="73" obj_id="1" fill_style="" tip="后退" plane="0" zaxis="0.000000" poke_style="0" level_d="0,0" script="" group="-1" icon_size="20,20" opacity="1.000000" short_cut="" file_name="" transformOriginPoint="0,0" strategy="" text="" style_sheet="QPushButton{ background-color: transparent; }" rect="40,11,30,30" icon_set="上一页.png" dy_nums="1" pixmap_name="" shape_info="0,0,1,0,0,0" font_t="SimSun,9,-1,5,50,0,0,0,0,0"/>
|
|
<item checked="0" taginfo0="" ocx_name="" show_plane="" show_only="1" name="m_next" transform="1,1" obj_type="73" obj_id="2" fill_style="" tip="前进" plane="0" zaxis="0.000000" poke_style="0" level_d="0,0" script="" group="-1" icon_size="20,20" opacity="1.000000" short_cut="" file_name="" transformOriginPoint="0,0" strategy="" text="" style_sheet="QPushButton{ background-color: transparent; }" rect="75,11,30,30" icon_set="下一页.png" dy_nums="1" pixmap_name="" shape_info="0,0,1,0,0,0" font_t="SimSun,9,-1,5,50,0,0,0,0,0"/>
|
|
<item checked="0" taginfo0="" ocx_name="" show_plane="" show_only="1" name="m_zoomIn" transform="1,1" obj_type="73" obj_id="3" fill_style="" tip="放大" plane="0" zaxis="0.000000" poke_style="0" level_d="0,0" script="" group="-1" icon_size="20,20" opacity="1.000000" short_cut="" file_name="" transformOriginPoint="0,0" strategy="" text="" style_sheet="QPushButton{ background-color: transparent; }" rect="1393,11,30,30" icon_set="zoomout.png" dy_nums="1" pixmap_name="" shape_info="0,0,1,0,0,0" font_t="SimSun,9,-1,5,50,0,0,0,0,0"/>
|
|
<item checked="0" taginfo0="" ocx_name="" show_plane="" show_only="1" name="m_zoomOut" transform="1,1" obj_type="73" obj_id="4" fill_style="" tip="缩小" plane="0" zaxis="0.000000" poke_style="0" level_d="0,0" script="" group="-1" icon_size="20,20" opacity="1.000000" short_cut="" file_name="" transformOriginPoint="0,0" strategy="" text="" style_sheet="QPushButton{ background-color: transparent; }" rect="1428,11,30,30" icon_set="zoomin.png" dy_nums="1" pixmap_name="" shape_info="0,0,1,0,0,0" font_t="SimSun,9,-1,5,50,0,0,0,0,0"/>
|
|
<item checked="0" taginfo0="" ocx_name="" show_plane="" show_only="1" name="m_zoom" transform="1,1" obj_type="73" obj_id="5" fill_style="" tip="等比" plane="0" zaxis="0.000000" poke_style="0" level_d="0,0" script="" group="-1" icon_size="20,20" opacity="1.000000" short_cut="" file_name="" transformOriginPoint="0,0" strategy="" text="" style_sheet="QPushButton{ background-color: transparent; }" rect="1462,11,30,30" icon_set="zoomfit.png" dy_nums="1" pixmap_name="" shape_info="0,0,1,0,0,0" font_t="SimSun,9,-1,5,50,0,0,0,0,0"/>
|
|
<item checked="0" taginfo0="" ocx_name="" show_plane="" show_only="1" name="m_snapScreen" transform="1,1" obj_type="73" obj_id="6" fill_style="" tip="快照" plane="0" zaxis="0.000000" poke_style="0" level_d="0,0" script="" group="-1" icon_size="20,20" opacity="1.000000" short_cut="" file_name="" transformOriginPoint="0,0" strategy="" text="" style_sheet="QPushButton{ background-color: transparent; }" rect="1497,11,30,30" icon_set="全屏截图.png" dy_nums="1" pixmap_name="" shape_info="0,0,1,0,0,0" font_t="SimSun,9,-1,5,50,0,0,0,0,0"/>
|
|
<item checked="0" taginfo0="" ocx_name="" show_plane="" show_only="1" name="m_index" transform="1,1" obj_type="73" obj_id="14" fill_style="" tip=" 首页" plane="0" zaxis="0.000000" poke_style="0" level_d="0,0" script="" group="-1" icon_size="20,18" opacity="1.000000" short_cut="" file_name="" transformOriginPoint="0,0" strategy="" text="" style_sheet="QPushButton{ background-color: transparent; }" rect="6,11,30,30" icon_set="index.png" dy_nums="1" pixmap_name="" shape_info="0,0,1,0,0,0" font_t="SimSun,9,-1,5,50,0,0,0,0,0"/>
|
|
<item checked="0" taginfo0="" ocx_name="" show_plane="" show_only="1" name="m_shotScreen" transform="1,1" obj_type="73" obj_id="39" fill_style="" tip="截屏" plane="0" zaxis="0.000000" poke_style="0" level_d="0,0" script="" group="-1" icon_size="20,20" opacity="1.000000" short_cut="" file_name="" transformOriginPoint="0,0" strategy="" text="" style_sheet="QPushButton{ background-color: transparent; }" rect="1532,11,30,30" icon_set="区域截图.png" dy_nums="1" pixmap_name="" shape_info="0,0,1,0,0,0" font_t="SimSun,9,-1,5,50,0,0,0,0,0"/>
|
|
<item checked="0" taginfo0="" ocx_name="" show_plane="" show_only="1" name="m_rollBtn" transform="1,1" obj_type="73" obj_id="52" fill_style="" tip="轮询" plane="0" zaxis="0.000000" poke_style="0" level_d="0,0" script="" group="-1" icon_size="20,20" opacity="1.000000" short_cut="" file_name="" transformOriginPoint="0,0" strategy="" text="" style_sheet="QPushButton{ background-color: transparent; }" rect="1566,11,30,30" icon_set="轮询.png" dy_nums="1" pixmap_name="" shape_info="0,0,1,0,0,0" font_t="SimSun,9,-1,5,50,0,0,0,0,0"/>
|
|
<item checked="0" taginfo0="" ocx_name="" show_plane="" show_only="1" name="m_pushAlarm" transform="1,1" obj_type="73" obj_id="57" fill_style="" tip="推图" plane="0" zaxis="0.000000" poke_style="0" level_d="0,0" script="" group="-1" icon_size="20,20" opacity="1.000000" short_cut="" file_name="" transformOriginPoint="0,0" strategy="" text="" style_sheet="QPushButton{ background-color: transparent; }" rect="1602,11,30,30" icon_set="推图.png" dy_nums="1" pixmap_name="" shape_info="0,0,1,0,0,0" font_t="SimSun,9,-1,5,50,0,0,0,0,0"/>
|
|
</plane>
|
|
<plane plane_name="轮询" count="1">
|
|
<item taginfo0="" ocx_name="HmiRollWidget" show_only="1" name="m_hmiRoll" transform="1,1" obj_type="86" obj_id="53" fill_style="" tip="" plane="1" zaxis="0.000000" level_d="0,0" script="" icon_size="30,30" opacity="1.000000" short_cut="" transformOriginPoint="0,0" strategy="" text="" style_sheet="" rect="769,9,183,32" icon_set="default.png" dy_nums="1" pixmap_name="" shape_info="0,617188,1,0,0,0" font_t="Microsoft YaHei,9,-1,5,50,0,0,0,0,0"/>
|
|
</plane>
|
|
<plane plane_name="导航" count="2">
|
|
<item taginfo0="" ocx_name="BreadcrumbNavWidget" show_only="1" name="m_breadcrumb" transform="1,1" obj_type="86" obj_id="55" fill_style="" tip="" plane="2" zaxis="0.000000" level_d="0,0" script="" icon_size="30,30" opacity="1.000000" short_cut="" transformOriginPoint="0,0" strategy="" text="" style_sheet="" rect="111,11,725,33" icon_set=".png" dy_nums="1" pixmap_name="" shape_info="0,617188,1,0,0,0" font_t="Microsoft YaHei,9,-1,5,50,0,0,0,0,0"/>
|
|
<item taginfo0="" point2="0,20" show_only="1" name="obj_56" transform="1,1" obj_type="1" obj_id="56" fill_style="brushIndex:0;Color[0,0,0];back_pixmap:;Gradient" plane="2" showEndArrow="0" zaxis="0.000000" showStartArrow="0" level_d="0,0" script="" pos="111,16" opacity="1.000000" transformOriginPoint="0,0" strategy="" dy_nums="1" point1="0,0" shape_info="1,46075,1,0,0,0"/>
|
|
</plane>
|
|
<script><![CDATA[
|
|
SView.loadScript('commonOpt.qs');
|
|
SView.loadScript('scriptCfg.qs');
|
|
|
|
var g_nodeName;
|
|
var g_optInsName = "hmi";
|
|
var g_domainId;
|
|
var g_locationId;
|
|
var g_appId;
|
|
var g_isCenter;
|
|
var g_timerId;
|
|
|
|
var g_zoomValue = 100;
|
|
|
|
var g_basicToolList = ["m_index", "m_pre", "m_next", "m_zoomIn", "m_zoomOut", "m_zoom", "m_snapScreen","m_shotScreen","m_rollBtn","m_breadcrumb","m_pushAlarm"];
|
|
var g_normalStyle = "background-color:transparent; border:1px;font:14px;color:rgb(0,179,251)";
|
|
var g_hoverStyle = "background-color:transparent;border:1px;font:14px;color:rgb(171,182,184)";
|
|
var g_toolBarStyle = "QPushButton:!hover {" + g_normalStyle + "}" + "QPushButton:hover {" + g_hoverStyle + "};";
|
|
|
|
var CH_LINK_TO_HMI_CTRL_UP = 103;
|
|
var MT_LINKAGE_ACTION_UP = 4;
|
|
var COMAPP_ID = 3;
|
|
|
|
var g_screenId = -1;
|
|
var g_isAutoRoll = false;
|
|
var g_isStart = false;
|
|
var g_rollTimeout = -1;
|
|
var g_autoTimeout = -1;
|
|
var g_curTimeout = -1;
|
|
var g_curGraph = [];
|
|
var g_rollGraph = [];
|
|
var g_rollGroup = "";
|
|
|
|
var g_pushGraph = "界面框架/panel_alarm_push.glx";
|
|
var g_alarmPushFlag = false;
|
|
|
|
function begin()
|
|
{
|
|
cLogin(0);
|
|
SView.setShowPlane("1,0,1");
|
|
|
|
SWnd.fileOpen("界面框架/frame_header.glx", "");
|
|
SWnd.fileOpen("界面框架/frame_footer.glx", "");
|
|
SWnd.fileOpen("界面框架/导航栏.glx", "");
|
|
SWnd.fileOpen("实时数据/首页.glx", "");
|
|
|
|
SWnd.fileSwitch.connect(onFileSwitch);
|
|
var page = SWnd.getIndexPic();
|
|
if(page)
|
|
{
|
|
SWnd.fileOpen(page, "view");
|
|
}
|
|
else
|
|
{
|
|
SWnd.fileOpen(g_homePage, "view");
|
|
}
|
|
var nodeInfo = SDAO.getLocalNodeInfo();
|
|
g_nodeName = nodeInfo["nodeName"].valueOf();
|
|
g_domainId = nodeInfo["domainId"].valueOf();
|
|
g_isCenter = nodeInfo["IsCenterDomain"].valueOf();
|
|
g_locationId = nodeInfo["locationId"].valueOf();
|
|
|
|
SForm.m_pre.enabled = false;
|
|
SForm.m_next.enabled = false;
|
|
SForm.m_index.setStyleSheet(g_toolBarStyle);
|
|
SForm.m_pre.setStyleSheet(g_toolBarStyle);
|
|
SForm.m_next.setStyleSheet(g_toolBarStyle);
|
|
SForm.m_zoomIn.setStyleSheet(g_toolBarStyle);
|
|
SForm.m_zoomOut.setStyleSheet(g_toolBarStyle);
|
|
SForm.m_zoom.setStyleSheet(g_toolBarStyle);
|
|
SForm.m_snapScreen.setStyleSheet(g_toolBarStyle);
|
|
SForm.m_shotScreen.setStyleSheet(g_toolBarStyle);
|
|
SForm.m_rollBtn.setStyleSheet(g_toolBarStyle);
|
|
SForm.m_pushAlarm.setStyleSheet(g_toolBarStyle);
|
|
|
|
//SForm.time.setStyleSheet("QLabel{color:rgba(0, 180, 255, 125);font-size:24px;font-family:Microsoft YaHei;}");
|
|
//SForm.date.setStyleSheet("QLabel{color:rgba(0, 180, 255, 125);font-size:18px;font-family:Microsoft YaHei;}");
|
|
//SForm.week.setStyleSheet("QLabel{color:rgba(0, 180, 255, 125);font-size:18px;font-family:Microsoft YaHei;}");
|
|
//updateTime();
|
|
|
|
SForm.m_index.clicked.connect(indexPic);
|
|
SForm.m_pre.clicked.connect(pre);
|
|
SForm.m_next.clicked.connect(next);
|
|
SForm.m_zoomIn.clicked.connect(zoomIn);
|
|
SForm.m_zoomOut.clicked.connect(zoomOut);
|
|
SForm.m_zoom.clicked.connect(zoom);
|
|
SForm.m_snapScreen.clicked.connect(snapScreen);
|
|
SForm.m_shotScreen.clicked.connect(shotScreen);
|
|
SForm.m_rollBtn.clicked.connect(rollSwitch);
|
|
SApp.keyPress.connect(onKey);
|
|
SApp.mousePress.connect(onMouse);
|
|
SApp.mouseMove.connect(onMouse);
|
|
SForm.m_breadcrumb.sigNodeClicked.connect(onBreadNodeClicked);
|
|
SForm.m_pushAlarm.clicked.connect(pushAlarm);
|
|
|
|
SWnd.fileOpen(g_pushGraph, "push", 3);
|
|
var code = "SView.hideView();";
|
|
SWnd.execute("", g_pushGraph, code);
|
|
|
|
code = "onButtonClicked(0);";
|
|
SWnd.execute("", "界面框架/frame_header.glx", code);
|
|
|
|
g_timerId = SView.startTimer(1000);
|
|
initLinkageMsg();
|
|
checkAutoRoll();
|
|
}
|
|
|
|
function end()
|
|
{
|
|
SView.stopTimer(g_timerId);
|
|
SView.closeMsg();
|
|
}
|
|
|
|
function onFileSwitch(name,tag,flags,replaceKey,args,type)
|
|
{
|
|
zoom();
|
|
|
|
var code = "onFileSwitch('"+name+"','"+tag+"',"+flags+",'"+replaceKey+"','"+args+"',"+ type+");";
|
|
SWnd.execute("","界面框架/导航栏.glx", code);
|
|
|
|
code = "getCurrentViewGraph();";
|
|
var data = SWnd.execute("","界面框架/导航栏.glx", code);
|
|
code = "getCurrentViewGraphName();";
|
|
var name = SWnd.execute("","界面框架/导航栏.glx", code);
|
|
SForm.m_breadcrumb.setCurrentGraph(data, name);
|
|
}
|
|
|
|
function onBreadNodeClicked(name,data,opt,url)
|
|
{
|
|
var code = "openGraph('"+ name + "','" + data + "'," + opt + ",'" + url + "')";
|
|
SWnd.execute("","界面框架/导航栏.glx", code);
|
|
}
|
|
|
|
function updateTime()
|
|
{
|
|
var date = new Date;
|
|
var year = date.getFullYear();
|
|
var month = date.getMonth();
|
|
var day = date.getDate();
|
|
var week = date.getDay();
|
|
var hour = date.getHours();
|
|
var min = date.getMinutes();
|
|
var second = date.getSeconds();
|
|
var weekDesc = ["日","一","二","三","四","五","六"];
|
|
var timeStr = toFillInt(hour) + ":" + toFillInt(min) + ":" + toFillInt(second);
|
|
var dateStr = year + "-" + toFillInt(month+1) + "-" + toFillInt(day);
|
|
SForm.time.text = timeStr;
|
|
SForm.week.text = "星期" + weekDesc[week];
|
|
SForm.date.text = dateStr;
|
|
}
|
|
|
|
function toFillInt(value)
|
|
{
|
|
var len = 2;
|
|
var ret = (Array(len).join('0') + value).slice(-len);
|
|
|
|
return ret;
|
|
}
|
|
|
|
function getTimeStr(sec)
|
|
{
|
|
var msec = parseInt(sec) * 1000;
|
|
var date = new Date(msec);
|
|
var year = date.getFullYear();
|
|
var month = date.getMonth();
|
|
var day = date.getDate();
|
|
var hour = date.getHours();
|
|
var min = date.getMinutes();
|
|
var second = date.getSeconds();
|
|
var timeStr = year + "-" + toFillInt(month+1) + "-" + toFillInt(day) + " "+ toFillInt(hour) + ":" + toFillInt(min) + ":" + toFillInt(second);
|
|
return timeStr;
|
|
}
|
|
|
|
function ontime()
|
|
{
|
|
//updateTime();
|
|
|
|
linkageActionUp();
|
|
|
|
hmiRoll();
|
|
if(g_alarmPushTwinkle)
|
|
{
|
|
stopAlarmPushTwinkle();
|
|
}
|
|
}
|
|
|
|
function setBasicToolEnabled(b)
|
|
{
|
|
for(var i = 0; i < g_basicToolList.length; i++)
|
|
{
|
|
var code = "SForm." + g_basicToolList[i] + ".enabled=" + b;
|
|
SView.execute(code);
|
|
}
|
|
}
|
|
|
|
function setOperatorEnabled(b)
|
|
{
|
|
var code = "SView.enabled=" + b;
|
|
SWnd.execute("", "界面框架/frame_header.glx", code);
|
|
SWnd.execute("", "界面框架/导航栏.glx", code);
|
|
SWnd.execute("", "界面框架/frame_footer.glx", code);
|
|
}
|
|
|
|
function indexPic()
|
|
{
|
|
var graphName = g_homePage;
|
|
var param = "view";
|
|
var code = "openGraph('','" + graphName + "','" + param + "',1,'')";
|
|
SWnd.execute("", "界面框架/导航栏.glx", code, -1);
|
|
}
|
|
|
|
function enabledPre(enable)
|
|
{
|
|
var context = SApp.getAppContext();
|
|
if(context == 3)
|
|
{
|
|
return;
|
|
}
|
|
SForm.m_pre.enabled = enable;
|
|
}
|
|
|
|
function enabledNext(enable)
|
|
{
|
|
var context = SApp.getAppContext();
|
|
if(context == 3)
|
|
{
|
|
return;
|
|
}
|
|
SForm.m_next.enabled = enable;
|
|
}
|
|
|
|
function pre()
|
|
{
|
|
var context = SApp.getAppContext();
|
|
if(context == 3)
|
|
{
|
|
return;
|
|
}
|
|
var code = "pre()";
|
|
SWnd.execute("", "界面框架/导航栏.glx", code);
|
|
}
|
|
|
|
function next()
|
|
{
|
|
var context = SApp.getAppContext();
|
|
if(context == 3)
|
|
{
|
|
return;
|
|
}
|
|
var code = "next()";
|
|
SWnd.execute("", "界面框架/导航栏.glx", code);
|
|
}
|
|
|
|
function zoomIn()
|
|
{
|
|
if(!zoomEnalbe())
|
|
{
|
|
return;
|
|
}
|
|
g_zoomValue += 20;
|
|
|
|
var code = "SView.zoom(" + g_zoomValue + ")";
|
|
// SWnd.execute("view", "", code);
|
|
// 通过按钮打开的图不是view
|
|
var curPage = SWnd.execute("", "界面框架/导航栏.glx", "getCurrentViewGraph();");
|
|
if(curPage == "")
|
|
{
|
|
SWnd.execute("view", "", code);
|
|
}
|
|
else
|
|
{
|
|
SWnd.execute("", curPage, code);
|
|
}
|
|
|
|
if(g_zoomValue >= 200)
|
|
{
|
|
SForm.m_zoomIn.enabled = false;
|
|
SForm.m_zoomOut.enabled = true;
|
|
return;
|
|
}
|
|
SForm.m_zoomOut.enabled = true;
|
|
}
|
|
|
|
function zoomOut()
|
|
{
|
|
if(!zoomEnalbe())
|
|
{
|
|
return;
|
|
}
|
|
g_zoomValue -= 20;
|
|
|
|
var code = "SView.zoom(" + g_zoomValue + ")";
|
|
// SWnd.execute("view", "", code);
|
|
// 通过按钮打开的图不是view
|
|
var curPage = SWnd.execute("", "界面框架/导航栏.glx", "getCurrentViewGraph();");
|
|
if(curPage == "")
|
|
{
|
|
SWnd.execute("view", "", code);
|
|
}
|
|
else
|
|
{
|
|
SWnd.execute("", curPage, code);
|
|
}
|
|
|
|
if(g_zoomValue <= 20)
|
|
{
|
|
SForm.m_zoomOut.enabled = false;
|
|
SForm.m_zoomIn.enabled = true;
|
|
return;
|
|
}
|
|
SForm.m_zoomIn.enabled = true;
|
|
}
|
|
|
|
function zoom()
|
|
{
|
|
if(!zoomEnalbe())
|
|
{
|
|
return;
|
|
}
|
|
g_zoomValue = 100;
|
|
SForm.m_zoomOut.enabled = true;
|
|
SForm.m_zoomIn.enabled = true;
|
|
var code = "SView.zoom(100);";
|
|
// SWnd.execute("view", "", code);
|
|
// 通过按钮打开的图不是view
|
|
var curPage = SWnd.execute("", "界面框架/导航栏.glx", "getCurrentViewGraph();");
|
|
if(curPage == "")
|
|
{
|
|
SWnd.execute("view", "", code);
|
|
}
|
|
else
|
|
{
|
|
SWnd.execute("", curPage, code);
|
|
}
|
|
}
|
|
|
|
function zoomEnalbe()
|
|
{
|
|
var graph = SWnd.execute("","界面框架/导航栏.glx","getCurrentViewGraph()");
|
|
if(graph == "界面框架/reportview.glx" || graph == "界面框架/reportdesign.glx")
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function snapScreen()
|
|
{
|
|
SWnd.snapScreen();
|
|
}
|
|
|
|
function shotScreen()
|
|
{
|
|
SWnd.shotScreen(1);
|
|
}
|
|
|
|
function getHomePage()
|
|
{
|
|
return g_homePage;
|
|
}
|
|
|
|
function getFaultPage()
|
|
{
|
|
return g_faultPage;
|
|
}
|
|
|
|
function reload()
|
|
{
|
|
var code = "reload()";
|
|
SWnd.execute("", "界面框架/panel_alarm_push.glx", code, 1);
|
|
SWnd.execute("", "界面框架/frame_header.glx", code, 1);
|
|
SWnd.execute("", "界面框架/frame_footer.glx", code, 1);
|
|
SWnd.execute("", "界面框架/alarm_window.glx", code, 1);
|
|
SWnd.execute("", "界面框架/event_window.glx", code, 1);
|
|
SWnd.execute("", "界面框架/view_user_group.glx", code, 1);
|
|
SWnd.execute("", "界面框架/view_user_manage.glx", code, 1);
|
|
SWnd.execute("", "界面框架/view_alarm_shield.glx", code, 1);
|
|
SWnd.execute("", "界面框架/view_alarm_strategy.glx", code, 1);
|
|
SWnd.execute("", "界面框架/reportdesign.glx", code, 1);
|
|
SWnd.execute("", "界面框架/reportview.glx", code, 1);
|
|
SWnd.execute("", "界面框架/view_bi_design.glx", code, 1);
|
|
SWnd.execute("", "界面框架/view_bi_view.glx", code, 1);
|
|
SWnd.execute("", "界面框架/view_bi_browser.glx", code, 1);
|
|
SWnd.execute("", "界面框架/view_web_energy.glx", code, 1);
|
|
}
|
|
|
|
function cLogin(timeout)
|
|
{
|
|
return SDAO.sysLogin(g_initUserName, g_initUserPwd, g_initUsergID, timeout);
|
|
}
|
|
|
|
function getInitUserName()
|
|
{
|
|
return g_initUserName;
|
|
}
|
|
|
|
function initLinkageMsg()
|
|
{
|
|
SView.InitMsg();
|
|
SView.addSub(COMAPP_ID, CH_LINK_TO_HMI_CTRL_UP);
|
|
}
|
|
|
|
function linkageActionUp()
|
|
{
|
|
var message = SView.recvMessage(MT_LINKAGE_ACTION_UP);
|
|
if (parseInt(message[0]) <= 0)
|
|
return;
|
|
|
|
var jsonObj = JSON.parse(message[1]);
|
|
|
|
if(jsonObj.nDstDomainID != g_domainId)
|
|
return;
|
|
|
|
if(jsonObj.strHostName != g_nodeName)
|
|
return;
|
|
|
|
if(jsonObj.nActOptType == 0)
|
|
{
|
|
var list = [];
|
|
list.push(-2);
|
|
list.push(getTimeStr(jsonObj.strTime));
|
|
list.push(jsonObj.strLocation);
|
|
list.push(jsonObj.strSubsystem);
|
|
list.push(jsonObj.strActionDesc);
|
|
list.push(jsonObj.strGraphName);
|
|
var code = "setPushAlarm('" + list.join(',') + "')";
|
|
SWnd.execute("", "界面框架/frame_header.glx", code);
|
|
}
|
|
else if(jsonObj.nActOptType == 1)
|
|
{
|
|
SWnd.fileOpen("界面框架/panel_hint_info.glx", "", 3, "", jsonObj.strHintInfo);
|
|
}
|
|
}
|
|
|
|
function onKey()
|
|
{
|
|
if(g_isStart)
|
|
{
|
|
return;
|
|
}
|
|
g_rollTimeout = g_autoTimeout;
|
|
}
|
|
|
|
function onMouse()
|
|
{
|
|
if(g_isStart)
|
|
{
|
|
return;
|
|
}
|
|
g_rollTimeout = g_autoTimeout;
|
|
}
|
|
|
|
function checkAutoRoll()
|
|
{
|
|
g_screenId = SWnd.getScreenIndex();
|
|
var group = SForm.m_hmiRoll.readScreenRoll(g_screenId);
|
|
if(group.length == 2)
|
|
{
|
|
g_isAutoRoll = true;
|
|
initRoll(group[0], group[1]);
|
|
}
|
|
}
|
|
|
|
function hmiRoll()
|
|
{
|
|
var context = SApp.getAppContext();
|
|
if(context == 2 || context == 3)
|
|
{
|
|
return;
|
|
}
|
|
if(g_rollTimeout == -1)
|
|
{
|
|
return;
|
|
}
|
|
|
|
g_rollTimeout--;
|
|
if(g_rollTimeout == 0)
|
|
{
|
|
if(g_rollGraph.length == 0)
|
|
{
|
|
g_rollGraph = g_curGraph.concat();
|
|
}
|
|
switchGraph();
|
|
}
|
|
}
|
|
|
|
function rollSwitch()
|
|
{
|
|
var arg = g_isAutoRoll + "," + g_isStart + "," + g_rollGroup + "," + g_autoTimeout + "," + g_screenId;
|
|
SWnd.fileOpen("界面框架/panel_roll_switch.glx", "", 3, "", arg);
|
|
}
|
|
|
|
function autoRollChange(auto, group, delay)
|
|
{
|
|
if(auto == "true")
|
|
{
|
|
g_isAutoRoll = true;
|
|
initRoll(group,delay);
|
|
}
|
|
else if(auto == "false")
|
|
{
|
|
resetRoll();
|
|
}
|
|
}
|
|
|
|
function onStartRoll(group)
|
|
{
|
|
g_isStart = true;
|
|
initRoll(group,0);
|
|
}
|
|
|
|
function onStopRoll()
|
|
{
|
|
resetRoll();
|
|
}
|
|
|
|
function configChange(changeGroup, delGroup)
|
|
{
|
|
if(g_rollGroup == "")
|
|
{
|
|
return;
|
|
}
|
|
var changeList = [];
|
|
changeList = changeGroup.split(',');
|
|
for(var n=0; n<changeList.length; n++)
|
|
{
|
|
var old = changeList[n].split('-')[0];
|
|
if(old == g_rollGroup)
|
|
{
|
|
g_rollGroup = changeList[n].split('-')[1];
|
|
break;
|
|
}
|
|
}
|
|
var delList = [];
|
|
delList = delGroup.split(',');
|
|
if(delList.indexOf(g_rollGroup) != -1)
|
|
{
|
|
resetRoll();
|
|
return;
|
|
}
|
|
|
|
if(g_isAutoRoll)
|
|
{
|
|
initRoll(g_rollGroup, g_autoTimeout);
|
|
}
|
|
else if(g_isStart)
|
|
{
|
|
initRoll(g_rollGroup, 1);
|
|
}
|
|
else
|
|
{}
|
|
}
|
|
|
|
function initRoll(group,delay)
|
|
{
|
|
g_autoTimeout = delay;
|
|
g_curTimeout = g_autoTimeout;
|
|
g_rollTimeout = g_autoTimeout;
|
|
g_rollGroup = group;
|
|
g_rollGraph = SForm.m_hmiRoll.readGraphRoll(g_rollGroup);
|
|
g_curGraph = g_rollGraph.concat();
|
|
if(g_rollGraph.length == 0)
|
|
{
|
|
resetRoll();
|
|
}
|
|
if(g_rollTimeout == 0){
|
|
switchGraph();
|
|
}
|
|
}
|
|
|
|
function switchGraph()
|
|
{
|
|
if(g_rollGraph.length <= 0)
|
|
{
|
|
return;
|
|
}
|
|
var graph = g_rollGraph.shift();
|
|
var code = "openRollGraph('" +graph+ "');";
|
|
SWnd.execute("", "界面框架/导航栏.glx", code, -1);
|
|
g_rollTimeout = g_rollGraph.shift();
|
|
g_curTimeout = g_rollTimeout;
|
|
}
|
|
|
|
function resetRoll()
|
|
{
|
|
g_autoTimeout = -1;
|
|
g_rollTimeout = g_autoTimeout;
|
|
g_curTimeout = g_rollTimeout;
|
|
g_curGraph = [];
|
|
g_rollGroup = "";
|
|
g_rollGraph = [];
|
|
g_isAutoRoll = false;
|
|
g_isStart = false;
|
|
}
|
|
|
|
function pushAlarm()
|
|
{
|
|
SWnd.fileOpen(g_pushGraph, "opt", 3);
|
|
}
|
|
|
|
function stopAlarmPushTwinkle()
|
|
{
|
|
g_alarmPushTwinkle = false;
|
|
SView.setPropertyValue("m_pushAlarm", "图标", "推图.png");
|
|
}
|
|
|
|
function startAlarmPushTwinkle()
|
|
{
|
|
g_alarmPushTwinkle = true;
|
|
SView.setPropertyValue("m_pushAlarm", "图标", "推图中.png");
|
|
}
|
|
|
|
]]></script>
|
|
</body>
|
|
</graph>
|