Esempio n. 1
0
func setSampleTime(m *models.PvInverterRunData, dataMap map[string]interface{}) {
	if sTime, ok := dataMap["SmplTime"].(uint64); ok {
		m.SmplTime = int64(sTime)

		hour, min, _ := time.Unix(m.SmplTime, 0).Clock()
		m.BatchOrder = int32(hour*12 + min/5 + 1)
		//fmt.Printf("SampleTime ---> BatchOrder:hour=%d, min=%d, batchOrder=%d\n", hour, min, m.BatchOrder)
	}
}
Esempio n. 2
0
func setBatchOrder(m *models.PvInverterRunData, dataMap map[string]interface{}) {
	if order, ok := dataMap["BatchOrder"].(uint64); ok {
		m.BatchOrder = int32(order)
	}
}