本文整理匯總了Golang中github.com/grayzone/devicemonitor/conn.Setting.Vrms方法的典型用法代碼示例。如果您正苦於以下問題:Golang Setting.Vrms方法的具體用法?Golang Setting.Vrms怎麽用?Golang Setting.Vrms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/grayzone/devicemonitor/conn.Setting
的用法示例。
在下文中一共展示了Setting.Vrms方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: worker
//.........這裏部分代碼省略.........
s.Maxretrycount = sessionres.MaxRetryCount
s.UpdateMaxretrycount()
case ftprotocol.DEVICENAMERESPONSE:
var res ftprotocol.DeviceNameResponse
res.Frame = f
err := res.ParseMessageData(f.MessageData)
if err != nil {
log.Println(err.Error())
m.Status = conn.INVALID
m.UpdateStatus()
continue
}
var s conn.Setting
// log.Println("device name : ", res.StringName)
s.Devicename = res.StringName
err = s.UpdateDevicename()
if err != nil {
log.Println("UpdateDevicename:", err.Error())
}
case ftprotocol.GETSENSORRESPONSE:
var res ftprotocol.GetSensorResponse
res.Frame = f
err := res.ParseMessageData(f.MessageData)
if err != nil {
log.Println("GETSENSORRESPONSE:", err.Error())
m.Status = conn.INVALID
m.UpdateStatus()
continue
}
var s conn.Setting
s.Sensorbroadcastperiod = res.BroadcastPeriod
err = s.UpdateSensorbroadcastperiod()
if err != nil {
log.Println("UpdateSensorbroadcastperiod :", err.Error())
}
case ftprotocol.DSP1SENSORDATA:
var res ftprotocol.Dsp1SensorData
res.Frame = f
err := res.ParseMessageData(f.MessageData)
if err != nil {
log.Println("DSP1SENSORDATA:", err.Error())
m.Status = conn.INVALID
m.UpdateStatus()
continue
}
var s conn.Sensordata
s.Isvaliddata = res.IsValidData
s.Sequencenumber = res.SequenceNumber
s.Isactivatingflag = res.IsActivatingFlag
s.Vavg = res.Vavg
s.Iavg = res.Iavg
s.Pavg = res.Pavg
s.Vrms = res.Vrms
s.Irms = res.Irms
s.Viphase = res.Viphase
s.Vpk = res.Vpk
s.Ipk = res.Ipk
s.Vcf = res.Vcf
s.Icf = res.Icf
s.Zload = res.Zload
s.T1 = res.T1
s.T2 = res.T2
s.Leakage = res.Leakage
s.Stimpos = res.Stimpos
s.Stimneg = res.Stimneg
s.Oltarget = res.Oltarget
s.Createtime = time.Now()
s.InsertSensordata()
case ftprotocol.EMPTY:
var s conn.Setting
s.Sequence = string(f.Sequence)
// log.Printf("sequence : %X", s.Sequence)
s.UpdateSequence()
default:
log.Printf("unsupported message : %X", msgid)
}
if len(s) > 0 {
m.Info = s
m.UpdateInfo()
} else {
// log.Println(m)
if bSoftDelete {
m.Status = conn.DELETED
m.UpdateStatus()
} else {
m.DeleteMessage()
// log.Println("the request is deleted.")
}
}
}
}