瀏覽代碼

时间传输问题

xcbosa 3 年之前
父節點
當前提交
4ad1b63920
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      WpfTest1/MainWindow.xaml.cs

+ 7 - 2
WpfTest1/MainWindow.xaml.cs

@@ -1682,17 +1682,22 @@ namespace WpfTest1
                         (byte)treatmentCustomModeList[i].tcInactiveTime,
                         (ushort)(treatmentCustomModeList[i].tcActiveTime + treatmentCustomModeList[i].tcInactiveTime));
                 }
-                comAgent.enqueueCommand(Com.createStartManualCommand((ushort)treatmentTime, (byte)(sliderStrength.Value * 100), steps));
+                comAgent.enqueueCommand(Com.createStartManualCommand(parseTreatmentTime(treatmentTime), (byte)(sliderStrength.Value * 100), steps));
             }
             else
             {
-                comAgent.enqueueCommand(Com.createStartDefinedCommand(targetTreatment.id, (ushort)treatmentTime, (byte)(sliderStrength.Value * 100)));
+                comAgent.enqueueCommand(Com.createStartDefinedCommand(targetTreatment.id, parseTreatmentTime(treatmentTime), (byte)(sliderStrength.Value * 100)));
             }
 
             isRunning = true;
             updateUIIsRunning();
         }
 
+        private ushort parseTreatmentTime(float f)
+        {
+            return (ushort)(f * 60);
+        }
+
         private void buttonStop_Click(object sender, RoutedEventArgs e)
         {
             if (checkBoxCustomMode.IsChecked.Value)