| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- function total_Infor(j, total_data) {
- len = total_data.length
- //显示总信息
- for (let i = 0; i <= len - 1; i++) {
- num = i + 1
- voltage = total_data[i].voltage.toFixed(2)
- current = total_data[i].current.toFixed(2)
- power = total_data[i].power
- power = power / 1000
- power = power.toFixed(3)
- consump = total_data[i].consump
- if (consump <= 0) {
- consump = 0
- }
- consump = consump / 1000
- consump = consump.toFixed(3)
- freq = total_data[i].freq.toFixed(2)
- Voltage = document.getElementById("L" + num + "_voltage")
- Current = document.getElementById("L" + num + "_current")
- Power = document.getElementById("L" + num + "_power")
- Consump = document.getElementById("L" + num + "_power_consumption")
- Freq = document.getElementById("L" + num + "_freq")
- Voltage.textContent = voltage
- Current.textContent = current
- Power.textContent = power
- Consump.textContent = consump
- Freq.textContent = freq
- }
- }
- function Channel_Info(j_data, channel_power_infro) {
- channel_length = channel_power_infro.length
- channel_display(j_data, channel_power_infro, channel_infro)
- }
- function threshold_mannage(orgin_data, channel_power_infro) {
- // 获取要插入新行的DOM元素
- const dataList = document.getElementById('threshold_mannage');
- // 清空现有的列表项
- dataList.innerHTML = '';
- channel_length = channel_power_infro.length
- //遍历数据数组
- for (let j = 1; j < channel_length; j++) {
- // 创建一个新的列表项元素
- const listItem = document.createElement('tr');
- dataList.appendChild(listItem);
- //自动生成电源类型列
- const power_type_td = document.createElement('td');
- power_type_td.textContent = "通道"
- dataList.appendChild(power_type_td);
- //自动生成名称列
- const Chananl_name_td = document.createElement('td');
- Chananl_name_td.textContent = "CH" + j
- dataList.appendChild(Chananl_name_td);
- //自动生成编号列
- const Chananl_num_td = document.createElement('td');
- Chananl_num_td.textContent = j
- dataList.appendChild(Chananl_num_td);
- //自动生成电流上限列
- const current_max_td = document.createElement('td');
- c_val = channel_power_infro[j].thr.c_upper / 10.0
- current_max_td.textContent = c_val
- dataList.appendChild(current_max_td);
- // 自动生成电压上限列
- const voltage_max_td = document.createElement('td');
- u_u_val = channel_power_infro[j].thr.v_upper / 10.0;
- //u_u_val = channel_power_infro[j].thr.v_upper.val;
- voltage_max_td.textContent = u_u_val;
- dataList.appendChild(voltage_max_td);
- // 自动生成电压下限列
- const voltage_min_td = document.createElement('td');
- u_l_val = channel_power_infro[j].thr.v_lower / 10.0;
- //u_l_val = channel_power_infro[j].thr.v_lower.val;
- voltage_min_td.textContent = u_l_val
- dataList.appendChild(voltage_min_td);
- // 自动生成功率上限列
- const power_max_td = document.createElement('td');
- p_val = channel_power_infro[j].thr.p_upper / 1000.0;
- //p_val = channel_power_infro[j].thr.p_upper.val;
- power_max_td.textContent = p_val
- dataList.appendChild(power_max_td);
- // 自动生成耗电量上限列
- const consump_td = document.createElement('td');
- c_val = channel_power_infro[j].thr.w_upper / 1000.0;
- //c_val = channel_power_infro[j].thr.w_upper.val;
- consump_td.textContent = c_val
- dataList.appendChild(consump_td);
- // 自动生成配置按钮列
- const operation_td = document.createElement('button');
- operation_td.textContent = '配置';
- operation_td.id = "edite" + j
- operation_td.style.width = '70px'
- operation_td.style.height = '50px'
- const translate = channel_power_infro[j]
- operation_td.addEventListener('click', function() {
- editRow(orgin_data, j, translate)
- })
- dataList.appendChild(operation_td);
- }
- }
- function now_time() {
- const now = new Date();
- // 获取年、月、日、小时、分钟和秒
- const year = now.getFullYear();
- const month = now.getMonth() + 1;
- const day = now.getDate();
- const hours = now.getHours();
- const minutes = now.getMinutes();
- const seconds = now.getSeconds();
- formattedTime = `${year}-${month < 10 ? '0' : ''}${month}-${day < 10 ? '0' : ''}${day} ${hours < 10 ? '0' : ''}${hours}:${minutes < 10 ? '0' : ''}${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
- return formattedTime
- }
|