xcbosa 3 年 前
コミット
dc7ee46493

+ 2 - 2
WpfTest1/ComAgent/ComAgent.cs

@@ -78,7 +78,7 @@ namespace WpfTest1.ComAgent
             }
             }
         }
         }
 
 
-        public static byte[] createStartDefinedCommand(int mode, ushort time, byte strongth)
+        public static byte[] createStartDefinedCommand(int mode, short time, byte strongth)
         {
         {
             List<byte> buff = new List<byte>();
             List<byte> buff = new List<byte>();
             buff.Add(getTCIDByIndex(mode));
             buff.Add(getTCIDByIndex(mode));
@@ -89,7 +89,7 @@ namespace WpfTest1.ComAgent
             return buff.ToArray();
             return buff.ToArray();
         }
         }
 
 
-        public static byte[] createStartManualCommand(ushort time, byte strongth, params TreatmentStep[] steps)
+        public static byte[] createStartManualCommand(short time, byte strongth, params TreatmentStep[] steps)
         {
         {
             List<byte> buff = new List<byte>();
             List<byte> buff = new List<byte>();
             buff.Add(0x53);
             buff.Add(0x53);

+ 1 - 0
WpfTest1/ComAgent/Extension.cs

@@ -119,6 +119,7 @@ namespace WpfTest1.ComAgent
 		public static byte[] buff(this int i) => BitConverter.GetBytes(i);
 		public static byte[] buff(this int i) => BitConverter.GetBytes(i);
 		public static byte[] buff(this uint i) => BitConverter.GetBytes(i);
 		public static byte[] buff(this uint i) => BitConverter.GetBytes(i);
 		public static byte[] buff(this uint16_t i) => BitConverter.GetBytes(i);
 		public static byte[] buff(this uint16_t i) => BitConverter.GetBytes(i);
+		public static byte[] buff(this short i) => BitConverter.GetBytes(i);
 		public static byte[] buff(this uint8_t i) => i.pack();
 		public static byte[] buff(this uint8_t i) => i.pack();
 
 
 		public static uint8_t[] packData(this uint8_t[] inputData)
 		public static uint8_t[] packData(this uint8_t[] inputData)

+ 2 - 2
WpfTest1/MainWindow.xaml.cs

@@ -1693,9 +1693,9 @@ namespace WpfTest1
             updateUIIsRunning();
             updateUIIsRunning();
         }
         }
 
 
-        private ushort parseTreatmentTime(float f)
+        private short parseTreatmentTime(float f)
         {
         {
-            return (ushort)(f * 60);
+            return (short)(f * 60);
         }
         }
 
 
         private void buttonStop_Click(object sender, RoutedEventArgs e)
         private void buttonStop_Click(object sender, RoutedEventArgs e)