From 536c87526f0b47ab54f52513a9cb7508dedcdc28 Mon Sep 17 00:00:00 2001 From: zhouhuang Date: Thu, 5 Dec 2024 13:20:55 +0800 Subject: [PATCH 01/12] update --- das-dn/hostadsbf/hostadsbf.cpp | 21 ++++--------------- das-dn/hostmodbustcpbf/host_modbus_tcp_bf.cpp | 4 ++-- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/das-dn/hostadsbf/hostadsbf.cpp b/das-dn/hostadsbf/hostadsbf.cpp index db79b2d0..af96387e 100644 --- a/das-dn/hostadsbf/hostadsbf.cpp +++ b/das-dn/hostadsbf/hostadsbf.cpp @@ -379,14 +379,14 @@ static void* ryftp_process(void* param) //获取此协议配置里面的ftp信息 char remote[512]; - char name[512]; + //char name[512]; //默认参数,或是通过协议配置获取 char user[128] = "administrator"; char password[128] = "123456"; char ipaddress[128] = "127.0.0.1"; char remotePath[128] = "Hard Disk2/data/rtdatalog"; - char pathName[128] = "./"; + //char pathName[128] = "./"; char processName[128]; snprintf(processName, sizeof(processName), "%s", mbt->GetCurProcessName()); @@ -826,25 +826,12 @@ BOOLEAN CHostADSBFProcess::OnPreCreate(int id) //SetLocalAmsNetId(AmsNetId(m_localNetId)); try { SetLocalAddress(AmsNetId(m_localNetId)); - - //192.168.0.231 addroute --addr=192.168.0.1 --netid=192.168.0.1.1.1 --password=1 --username=guest --routename=Testroute - //AddRemoteRoute(m_remoteIp, m_localNetId, m_localIp, std::string("isoftstone"), std::string("guest"), std::string("1")); - //m_remotePort - //m_turbine = new AdsDevice{m_remoteIp, AmsNetId(m_remoteNetId), AMSPORT_R0_PLC_RTS1}; - m_turbine = new AdsDevice{m_remoteIp, AmsNetId(m_remoteNetId), m_remotePort}; - //if (m_turbine->IsConnected()) - { - if (!readDeviceState(*m_turbine)) - { - // delete m_turbine; - // m_turbine = NULL; - // m_turbine = new AdsDevice{m_remoteIp, AmsNetId(m_remoteNetId), m_remotePort}; - } - } } catch (const AdsException& ex) { vLog(LOG_ERROR, "Error: %d\n", ex.errorCode); vLog(LOG_ERROR, "AdsException message: %s\n", ex.what()); + vLog(LOG_DEBUG, "try to add a route to remote device.\n"); + AddRemoteRoute(m_remoteIp, m_localNetId, m_localIp, std::string("isoftstone"), std::string("guest"), std::string("1")); } catch (const std::runtime_error& ex) { vLog(LOG_ERROR, "%s\n", ex.what()); } diff --git a/das-dn/hostmodbustcpbf/host_modbus_tcp_bf.cpp b/das-dn/hostmodbustcpbf/host_modbus_tcp_bf.cpp index b0d47604..0e5f3300 100644 --- a/das-dn/hostmodbustcpbf/host_modbus_tcp_bf.cpp +++ b/das-dn/hostmodbustcpbf/host_modbus_tcp_bf.cpp @@ -406,14 +406,14 @@ static void* ryftp_process(void* param) //获取此协议配置里面的ftp信息 char remote[512]; - char name[512]; + //char name[512]; //默认参数,或是通过协议配置获取 char user[128] = "administrator"; char password[128] = "123456"; char ipaddress[128] = "127.0.0.1"; char remotePath[128] = "/data/rtdatalog"; - char pathName[128] = "./"; + //char pathName[128] = "./"; char processName[128]; snprintf(processName, sizeof(processName), "%s", mbt->GetCurProcessName()); From 9250fdb2a4b91ac75a57008a1644a685188e66e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E4=BA=91=E9=B9=8F?= Date: Thu, 5 Dec 2024 13:29:03 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E8=AE=BE=E5=A4=87=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=9E=8B=E5=8F=B7=E5=8F=82=E6=95=B0=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipment/equipmentManagement/index.vue | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/ui/dasadmin/src/views/backend/equipment/equipmentManagement/index.vue b/ui/dasadmin/src/views/backend/equipment/equipmentManagement/index.vue index e2fe7970..6507eda8 100644 --- a/ui/dasadmin/src/views/backend/equipment/equipmentManagement/index.vue +++ b/ui/dasadmin/src/views/backend/equipment/equipmentManagement/index.vue @@ -118,12 +118,15 @@ - + - + + + + @@ -241,7 +244,7 @@ @@ -284,12 +287,14 @@ - + - + + + @@ -412,7 +417,7 @@ @@ -486,6 +491,7 @@ import { encrypt_aes, generateRandomNumber } from '/@/utils/crypto' import ControlPage from './control.vue' import MeasurementPage from './measurement.vue' import { ModelAttributeType } from '/@/views/backend/auth/model/type' +import { theoreticalpowerCurveList } from '/@/api/backend/theoreticalpowerCurve/request' const adminInfo = useAdminInfo() interface Tree { @@ -728,6 +734,28 @@ const editDeviceData = reactive({ nominalCapacity: null, }) +const modelList = ref<{ model: string; madeinFactory: string }[]>([]) + +const getModelList = () => { + theoreticalpowerCurveList().then((res) => { + if (res.rows) { + console.log(res); + + modelList.value = (res.rows as any[]).map((item: any) => { + return { + model: item.model, + madeinFactory: item.madeinfactory, + } + }) + } + }) +} +const selectEditModel = (value:string)=>{ + editDeviceData.madeinFactory = modelList.value.find((item) => item.model == value)?.madeinFactory || '' +} +const selectAddModel = (value:string)=>{ + editAddDeviceData.madeinFactory = modelList.value.find((item) => item.model == value)?.madeinFactory || '' +} const size = ref<'default' | 'large' | 'small'>('default') const handleCloseEditDevice = () => { @@ -1026,6 +1054,8 @@ const openMeasure = (data: any) => { watch(showMeasure, (newVal: boolean) => { !newVal && (measureData.autoUpdate = false) }) + +getModelList()