|
本帖最后由 zhengxb 于 2018-12-6 10:04 编辑
应用示例可查看_MATRIX 和_AUDIO方法,可自行修改相关方法属性及添加方法属性。有任何问题建议可在下方留言,功能持续改进更新
附:
function _COM(vPort,vB,vN,vD,vS,fnGetData)
{
this.modPrj = _SUBPROJECT_;
this.callButton = function(btnName)
{
CallObject(this.modPrj,btnName);
}
this.port = vPort;
if(vPort.indexOf('MOD')!=-1)
{
this.port = GetCurrentIOName();
}
if(this.port.indexOf('COM')!=-1)
{
setComBaud(this.port,vB,vN,vD,vS);
}
this.setComBaud = function(vsB,vsN,vsD,vsS)
{
setComBaud(this.port,vsB,vsN,vsD,vsS)
}
this.sendCodeString = function(vString)
{
sendCodeString(this.port,vString);
}
this.delayCodeString = function(vSec,vString)
{
delayCodeString(vSec,this.port,vString);
}
this.sendCodeName = function(vString)
{
sendCodeName(this.port,vString);
}
this.delayCodeName = function(vSec,vString)
{
delayCodeName(vSec,this.port,vString);
}
this.getRev = function(vData)
{
fnGetData(vData);
}
if(arguments.length>=6)
{
setStringReceive(this.port,this.getRev);
}
}
|
|