|
|
@@ -5,7 +5,10 @@ import (
|
|
|
"dashoo.cn/backend/api/business/workflow"
|
|
|
. "dashoo.cn/backend/api/mydb"
|
|
|
"dashoo.cn/utils"
|
|
|
+ "fmt"
|
|
|
"github.com/go-xorm/xorm"
|
|
|
+ "math"
|
|
|
+ "strconv"
|
|
|
"strings"
|
|
|
)
|
|
|
|
|
|
@@ -33,6 +36,48 @@ func (s *LimsReportMotorService) DataToExcelReport(entrustMainEntity limsentrust
|
|
|
|
|
|
svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
datamap := make(map[string]interface{})
|
|
|
+ kQ := float64(0.04)
|
|
|
+ u := float64(reportList[0].RatedVoltage) // 额定电压
|
|
|
+ i := float64(reportList[0].NoloadCurrent) // 空载电流
|
|
|
+ pn := float64(reportList[0].RatedPower) // 额定功率
|
|
|
+ p1 := float64(45)
|
|
|
+ po := float64(reportList[0].RatedNoloadPower) //空载功率
|
|
|
+ etaN := float64(reportList[0].RatedEfficiency)/100 //额定效率
|
|
|
+ cosN := float64(reportList[0].RatedPowerFactor) //额定功率因数
|
|
|
+ cosphi := float64(reportList[0].PowerFactor) //电机功率因数
|
|
|
+
|
|
|
+ deltaPn,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", (1/etaN-1)*pn),64) // 额定负载有功损耗
|
|
|
+ qn,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", pn/etaN*(math.Sqrt(1-cosN*cosN)/cosN)), 64) //额定负载时无功功率
|
|
|
+ qo,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", math.Sqrt(3*math.Pow(u*i,2)* math.Pow(10,-6)-math.Pow(po,2))), 64) // 空载无功功率
|
|
|
+ deltaPcn,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", deltaPn+kQ*qn),64) // 额定综合功率损耗
|
|
|
+ beta,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", (-pn/2+math.Sqrt(math.Pow(pn,2)/4+(deltaPn-po)*(p1-po)))/(deltaPn-po)),64) // 运行负载系数
|
|
|
+ deltaPc,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", po+math.Pow(beta,2)*(deltaPn-po)+kQ*qo+kQ*math.Pow(beta,2)*(qn-qo)),64) //综合功率损耗
|
|
|
+ etac,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", beta*pn/(beta*pn+deltaPc)), 64) // 综合效率
|
|
|
+ etacN,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", pn/(pn+deltaPcn)), 64) // 额定综合效率
|
|
|
+ eta1c,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", etacN*0.6), 64) // 运行综合效率
|
|
|
+ eta,_ := strconv.ParseFloat(fmt.Sprintf("%.3f", beta*pn/p1), 64) // 电机效率
|
|
|
+ // 电机功率因数
|
|
|
+ fmt.Println(math.Pow(u*i,2), math.Pow(po,2))
|
|
|
+ fmt.Println(etac, eta1c, eta)
|
|
|
+
|
|
|
+ datamap["deltaPn"] = deltaPn
|
|
|
+ datamap["qn"] = qn
|
|
|
+ datamap["qo"] = qo
|
|
|
+ datamap["deltaPcn"] = deltaPcn
|
|
|
+ datamap["beta"] = beta
|
|
|
+ datamap["deltaPc"] = deltaPc
|
|
|
+ datamap["etac"] = etac*100
|
|
|
+ datamap["etacN"] = etacN*100
|
|
|
+ datamap["eta1c"] = eta1c*100
|
|
|
+ datamap["eta"] = eta*100
|
|
|
+ datamap["cosphi"] = cosphi
|
|
|
+
|
|
|
+ datamap["DJModel"] = reportList[0].MotorType // 电机型号
|
|
|
+ datamap["RP"] = reportList[0].RatedPower // 额定功率
|
|
|
+ datamap["RNP"] = reportList[0].RatedNoloadPower //空载功率
|
|
|
+ datamap["RF"] = reportList[0].RatedEfficiency //额定效率
|
|
|
+ datamap["RPF"] = reportList[0].RatedPowerFactor //额定功率因数
|
|
|
+
|
|
|
datamap["code"] = seqStr
|
|
|
datamap["company"] = reportList[0].TestDepart
|
|
|
datamap["jcnum"] = reportList[0].SectionMonitor
|