Skip to content

Commit

Permalink
1.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bambooww committed Oct 7, 2024
1 parent c336f39 commit 23bace3
Show file tree
Hide file tree
Showing 14 changed files with 151 additions and 16 deletions.
10 changes: 10 additions & 0 deletions core/src/main/java/org/iottree/core/DevDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ public List<IAddrDef> getAddrDefs()
{
return null ;
}

// /**
// * impl will provider special prop for devive in ch
// * @param dev
// * @return
// */
// public HashMap<String,String> getPropMapForDevInCh(UADev dev)
// {
// return null ;
// }
}
// ---------------------dev cat and device

Expand Down
13 changes: 11 additions & 2 deletions core/src/main/java/org/iottree/core/UAPrj.java
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,16 @@ private void startStopCh(boolean b)
}
}

private static void RT_initContext(UANodeOCTagsCxt cxt)
{
//old context with js env will rebuild
for(UANodeOCTagsCxt subcxt :cxt.getSubNodesCxt())
{
RT_initContext(subcxt) ;
}
cxt.RT_reContext();
}

private static long PRJ_RUN_INTERVAL = 5 ;

Runnable prjRunner = new Runnable() {
Expand All @@ -1048,8 +1058,7 @@ public void run()
{
RT_init(true, true) ;

//old context with js env will rebuild
RT_reContext();
RT_initContext(UAPrj.this) ;

if(b_rec)
RecManager.getInstance(UAPrj.this).RT_start() ;
Expand Down
15 changes: 11 additions & 4 deletions core/src/main/java/org/iottree/core/conn/ConnProCOM.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.iottree.core.ConnProvider;
import org.iottree.core.ConnPt;
import org.iottree.core.util.Convert;
import org.iottree.core.util.Env;
import org.iottree.core.util.xmldata.XmlData;
import org.w3c.dom.Element;

Expand All @@ -26,14 +27,20 @@ public static boolean usingRxTx()
return bRxTx ;

Element ele = Config.getConfElement("system");
if(ele==null)
if(ele!=null && "true".equalsIgnoreCase(ele.getAttribute("rxtx")) )
{
bRxTx = false;
return false;
bRxTx = true ;
return true ;
}

bRxTx = "true".equalsIgnoreCase(ele.getAttribute("rxtx")) ;
bRxTx = Env.isJVM_Win32();
return bRxTx ;
// if(bRxTx!=null)
// return bRxTx ;
//



}

public static List<String> listSysComs()
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/iottree/core/conn/ConnPtCOM.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private synchronized boolean connectNor()
try
{
serialPort = SerialPort.getCommPort(comId); // 替换为你的串口
serialPort.setBaudRate(9600);
//serialPort.setBaudRate(9600);

// static final public int ONE_STOP_BIT = 1;
// static final public int ONE_POINT_FIVE_STOP_BITS = 2;
Expand Down
69 changes: 69 additions & 0 deletions core/src/main/java/org/iottree/core/conn/ConnPtMSGMultiTcp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package org.iottree.core.conn;

import java.io.File;

import org.iottree.core.UATag;

public class ConnPtMSGMultiTcp extends ConnPtMSG
{

@Override
public boolean sendMsg(String topic, byte[] bs) throws Exception
{
return false;
}

@Override
public void runOnWrite(UATag tag, Object val) throws Exception
{
// TODO Auto-generated method stub

}

@Override
public boolean isPassiveRecv()
{
// TODO Auto-generated method stub
return false;
}

@Override
protected boolean readMsgToFile(File f) throws Exception
{
return false;
}

@Override
public String getConnType()
{
return null;
}

@Override
public String getStaticTxt()
{
return null;
}

@Override
public void RT_checkConn()
{
// TODO Auto-generated method stub

}

@Override
public boolean isConnReady()
{
// TODO Auto-generated method stub
return false;
}

@Override
public String getConnErrInfo()
{
// TODO Auto-generated method stub
return null;
}

}
12 changes: 10 additions & 2 deletions core/src/main/java/org/iottree/core/msgnet/MNManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,16 @@ boolean RT_CXT_load() throws IOException
for (MNNet net : this.listNets())
{
File cxtf = getRTCxtFileNet(net);
jo = Convert.readFileJO(cxtf);
net.RT_CXT_fromSavedJO(jo);
try
{
jo = Convert.readFileJO(cxtf);
net.RT_CXT_fromSavedJO(jo);
}
catch(Exception ee)
{
log.warn("MNManager in ["+belongTo.getMsgNetContainerId()+"] load net failed:"+cxtf.getCanonicalPath());
//ee.printStackTrace();
}
}
return true;
}
Expand Down
6 changes: 5 additions & 1 deletion core/src/main/java/org/iottree/core/station/PStation.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ public long getKeepMaxLen()
return this.keepMaxLen ;
}

public long getLastRecvDT()
{
return this.lastRecvedDT ;
}

public void setFailedKeep(boolean b_failed_keep,long keep_max_len)
{
this.bFailedKeep = b_failed_keep ;
Expand Down Expand Up @@ -457,7 +462,6 @@ public PSCmdDirSyn.DirDiff RT_synDirDiff(String module,String path,long timeout,
return (PSCmdDirSyn.DirDiff)recvob ;
}


private JSONObject RT_synDirSynRecved = null;

private String downloadToken = null ;
Expand Down
20 changes: 20 additions & 0 deletions core/src/main/java/org/iottree/core/util/Env.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.iottree.core.util;

public class Env
{
static final String OS = System.getProperty("os.name").toLowerCase();
static final String arch = System.getProperty("os.arch").toLowerCase();

public static boolean isOSWin()
{
return OS.contains("win") ;
}

public static boolean isJVM_Win32()
{
if(!isOSWin())
return false ;

return arch.equals("x86") ;
}
}
2 changes: 1 addition & 1 deletion server/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

</webapps>

<system >
<system>
<inner_comp name="rec" enable="false" />
<!--
<server_comp class="org.iottree.driver.opc.opcua.server.OpcUAServer"/>
Expand Down
2 changes: 1 addition & 1 deletion server/platform.json → server/platform-.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"stations":[
{"id":"station1","t":"Station1","key":"12322131231"},
{"id":"atom","t":"Atom","key":"12322131231"},
{"id":"station2","t":"Station2","key":"12322131231"}
],
"prj_up_dir":"$data_dyn:/platform/prj_up/",
Expand Down
1 change: 1 addition & 0 deletions web/ROOT/WEB-INF/classes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/org/
4 changes: 2 additions & 2 deletions web/admin/conn/lang.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<dd_node id="1" name="stop_bits" name_cn="停止位" name_en="Stop Bits" />
<dd_node id="1" name="parity" name_cn="奇偶校验" name_en="Parity" />
<dd_node id="1" name="parity_none" name_cn="无校验" name_en="None" />
<dd_node id="1" name="parity_odd" name_cn="奇校验" name_en="Odd" />
<dd_node id="1" name="parity_even" name_cn="偶校验" name_en="Even" />
<dd_node id="1" name="parity_odd" name_cn="偶校验" name_en="Odd" />
<dd_node id="1" name="parity_even" name_cn="奇校验" name_en="Even" />
<dd_node id="1" name="flow_ctrl" name_cn="流控" name_en="Flow Control" />
<dd_node id="1" name="com_port" name_cn="串口" name_en="Port" />

Expand Down
10 changes: 8 additions & 2 deletions web/admin/platform/platform.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,15 @@ for(Map.Entry<String,PStation> id2s:id2station.entrySet())
String failed_keep_chked = prjst.isFailedKeep()?"checked":"" ;
long keep_max_len = prjst.getKeepMaxLen() ;
long last_recv_dt = prjst.getLastRecvDT() ;
String lastrdt = "" ;
if(last_recv_dt>0)
lastrdt = Convert.toFullYMDHMS(new Date(last_recv_dt)) ;
%>
<div class="prj_item">
<%=prjst.getPrjName() %> running=<%=prjst.isRunning() %> auto start=<%=prjst.isAutoStart() %><br>
<%=prjst.getPrjName() %> running=<%=prjst.isRunning() %> auto start=<%=prjst.isAutoStart() %>
-&gt;[<%=lastrdt%>]
<br>

<button onclick="station_prj_start_stop('<%=ps.getId() %>','<%=prjst.getPrjName() %>',true)">start</button>
<button onclick="station_prj_start_stop('<%=ps.getId() %>','<%=prjst.getPrjName() %>',false)">stop</button>
Expand All @@ -159,7 +165,7 @@ for(Map.Entry<String,PStation> id2s:id2station.entrySet())
<%
}
%>
<input type="checkbox" id="autostart_<%=ps.getId() %>_<%=prjst.getPrjName() %>" <%=chked %>/>Auto Start
<input type="checkbox" id="autostart_<%=ps.getId() %>_<%=prjst.getPrjName() %>" <%=chked %>/>Auto Start <br>
<input type="checkbox" id="syn_en_<%=ps.getId() %>_<%=prjst.getPrjName() %>" <%=syn_chked %>/>Data Syn
Interval <input type="number" id="syn_intv_<%=ps.getId() %>_<%=prjst.getPrjName() %>" value="<%=syn_intv %>" style="width:65px"/>
<br>Failed Keep <input type="checkbox" id="failed_keep_<%=ps.getId() %>_<%=prjst.getPrjName() %>" <%=failed_keep_chked %> style="width:65px"/>
Expand Down
1 change: 1 addition & 0 deletions web/admin/util/snoop.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
URL tmpu = new URL(u.toString()) ;
%>
ms=<%=System.currentTimeMillis() %><br>;
tbs_data=<%=Config.getDataDirBase() %><br/>
conf_dir=<%=Config.getConfigFileBase()%><br/>
webapp_dir=<%=Config.getWebappBase() %><br/>
Expand Down

0 comments on commit 23bace3

Please sign in to comment.