@@ -48,13 +48,12 @@ public RSCommunication(string portName, uint baudRate, Parity parityNumber, uint
4848
4949 }
5050
51- public decimal [ ] getMeasurementParams ( string msType , string multiplier , bool addD = false , int waitFetchMs = 700 )
51+ public decimal [ ] getMeasurementParams ( string msType , string multiplier , bool addD = false , int waitFetchMs = 400 )
5252 {
5353
5454 string d_Parameter = null ;
5555 decimal [ ] responseDecimalArray = new decimal [ 3 ] ;
5656
57-
5857 // dodatkowe opcjonalne mierzenie parametru D
5958 if ( addD )
6059 {
@@ -70,10 +69,9 @@ public decimal[] getMeasurementParams(string msType, string multiplier, bool add
7069 if ( msType == "DCR" )
7170 waitFetchMs += 3000 ;
7271
73- System . Threading . Thread . Sleep ( waitFetchMs ) ;
72+ System . Threading . Thread . Sleep ( waitFetchMs ) ;
7473 _serialPort . WriteLine ( "FETCH?" ) ;
7574
76- string cos = _serialPort . ReadLine ( ) ;
7775
7876 try
7977 {
@@ -94,7 +92,7 @@ public decimal[] getMeasurementParams(string msType, string multiplier, bool add
9492 MessageBoxResult result = System . Windows . MessageBox . Show ( "Błąd pomiaru, czy chcesz ponowić pomiar na tych samych parametrach?" , "Błąd" , MessageBoxButton . OKCancel ) ;
9593 if ( result == MessageBoxResult . OK )
9694 {
97- getMeasurementParams ( msType , multiplier , addD , waitFetchMs += 700 ) ;
95+ responseDecimalArray = getMeasurementParams ( msType , multiplier , addD , waitFetchMs += 700 ) ;
9896 }
9997 else
10098 {
@@ -177,7 +175,7 @@ public void setMeasurementInDevice(string command)
177175 _serialPort . Dispose ( ) ;
178176 _serialPort . Close ( ) ;
179177 _serialPort . Open ( ) ;
180- System . Threading . Thread . Sleep ( 3000 ) ;
178+ System . Threading . Thread . Sleep ( 1000 ) ;
181179 }
182180
183181
0 commit comments