Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
187ce232a8
@ -1387,6 +1387,19 @@ BOOLEAN CRYDevice::processRyADSParam(const Json::Value jsonRoot, int pid)
|
||||
vLog(LOG_ERROR, "inet_pton error(%d,%s).\n", errno, strerror(errno));
|
||||
}
|
||||
}
|
||||
//ads添加路由的用户名密码
|
||||
//用户名
|
||||
if (jsonRoot["adsUser"].isString()) {
|
||||
snprintf(config_config.processes[pid].option.ryads.user, sizeof(config_config.processes[pid].option.ryads.user), "%s", jsonRoot["adsUser"].asCString());
|
||||
} else { //默认存在允许ftp功能
|
||||
snprintf(config_config.processes[pid].option.ryads.user, sizeof(config_config.processes[pid].option.ryads.user), "%s", "admin");
|
||||
}
|
||||
//密码
|
||||
if (jsonRoot["adsPassword"].isString()) {
|
||||
snprintf(config_config.processes[pid].option.ryads.password, sizeof(config_config.processes[pid].option.ryads.password), "%s", jsonRoot["adsPassword"].asCString());
|
||||
} else { //默认存在允许ftp功能
|
||||
snprintf(config_config.processes[pid].option.ryads.password, sizeof(config_config.processes[pid].option.ryads.password), "%s", "admin");
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -883,6 +883,9 @@ BOOLEAN CHostADSBFProcess::OnPreCreate(int id)
|
||||
//目标端口
|
||||
m_remotePort = m_nOptions.net.target_port;
|
||||
|
||||
m_adsUser = std::string(m_nOptions.user);
|
||||
m_adsPassword = std::string(m_nOptions.password);
|
||||
|
||||
m_bHaveFTP = m_nOptions.bHaveFTP;
|
||||
calc();
|
||||
|
||||
@ -974,8 +977,8 @@ BOOLEAN CHostADSBFProcess::OnTimer(void)
|
||||
//先添加一条路由
|
||||
if (m_bRouteAdded == FALSE)
|
||||
{
|
||||
long ret = AddRemoteRoute(m_remoteIp, AmsNetId(m_localNetId), m_localIp, std::string("isoftstone"), std::string("admin"), std::string("admin"));
|
||||
vLog(LOG_DEBUG, "%s add route(%s to %s) return value is: %d\n", m_pidName.c_str(), m_localIp.c_str(), m_remoteIp.c_str(), ret);
|
||||
long ret = AddRemoteRoute(m_remoteIp, AmsNetId(m_localNetId), m_localIp, std::string("isoftstone"), m_adsUser, m_adsPassword);
|
||||
vLog(LOG_DEBUG, "%s add route(%s to %s) with remote user name: %s, and remote password: %s, return value is: %d\n", m_pidName.c_str(), m_localIp.c_str(), m_remoteIp.c_str(), m_adsUser.c_str(), m_adsPassword.c_str(), ret);
|
||||
if (ret != 0) return TRUE;
|
||||
}
|
||||
m_bRouteAdded = TRUE;
|
||||
|
@ -43,6 +43,8 @@ private:
|
||||
std::string m_localNetId; //本机IP地址
|
||||
std::string m_remoteIp; //PLC设备ip地址
|
||||
std::string m_remoteNetId;
|
||||
std::string m_adsUser;
|
||||
std::string m_adsPassword;
|
||||
|
||||
AdsDevice *m_turbine;
|
||||
BOOLEAN m_bRouteAdded; //路由是否添加成功
|
||||
|
@ -626,6 +626,8 @@ typedef struct
|
||||
struNetWorkOption net;
|
||||
BOOLEAN bHaveFTP;
|
||||
struFTPOption ftp;
|
||||
char user[64];
|
||||
char password[64];
|
||||
} struRYADSOption;
|
||||
|
||||
typedef struct
|
||||
|
@ -353,7 +353,7 @@ public class DataServiceImpl implements DataService {
|
||||
|
||||
/**
|
||||
* 获取指定时间区间内的最早的数据
|
||||
* @param devcieId
|
||||
* @param deviceId
|
||||
* @param attr
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
|
@ -170,7 +170,7 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
|
||||
sysEquipmentMapper.deleteById(sysEquipmentDto.getId());
|
||||
//删除缓存
|
||||
//更新设备缓存
|
||||
cacheService.getEquipmentCache().refreshDeviceCache(sysEquipmentDto.getId());
|
||||
cacheService.getEquipmentCache().removeDeviceCache(sysEquipmentDto.getId());
|
||||
dataService.deviceModelMap.remove(sysEquipmentDto.getId().toString());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user