public static void OnMqttServer_ApplicationMessageReceived(MqttApplicationMessageReceivedEventArgs e)
        {
            string payload = Encoding.UTF8.GetString(e.ApplicationMessage.Payload);
            string topic   = e.ApplicationMessage.Topic;

            if (topic == "/data/chart")
            {
                ChartDisplayData chartDisplayData = JsonToObject <ChartDisplayData>(payload);
                //double[] chartDisplayData = JsonToObject<double[]>(payload);
                _hub.Clients.All.SendAsync("ReceiveChartDisplayData", chartDisplayData);
            }
            //Debug.WriteLine($"客户端[{e.ClientId}]>> 主题:{topic} 负荷:{payload} Qos:{e.ApplicationMessage.QualityOfServiceLevel} 保留:{e.ApplicationMessage.Retain}");
        }
 public async Task PostChartData(ChartDisplayData chartDisplayData)
 {
     await Clients.All.SendAsync("ReceiveChartDisplayData", chartDisplayData);
 }
        public async Task <ActionResult <ChartDisplayData> > PostChartData(ChartDisplayData chartDisplayData)
        {
            await _hub.Clients.All.SendAsync("ReceiveChartDisplayData", chartDisplayData);

            return(chartDisplayData);
        }