Subversion Repositories Projects

Compare Revisions

Regard whitespace Rev 2334 → Rev 2335

/MKLiveView/v1.0/Source/MainWindow.xaml.cs
697,7 → 697,19
{
MainMap.Markers.Remove(home);
}
void _clearMapMarkers(Type markerType)
{
for (int k = 0; k < MainMap.Markers.Count;)
{
GMapMarker p = MainMap.Markers[k];
if (p.GetType() == markerType | p.Shape.GetType() == markerType)
MainMap.Markers.Remove(p);
else
k++;
}
 
}
 
// access mode
private void comboBoxMode_DropDownClosed(object sender, EventArgs e)
{
1655,7 → 1667,7
}
if (_bVoiceSatFixPlay && !_bVoiceSatFixActive)
{
Thread th = new Thread(() => _mediaPlayer("Voice\\CriticalBattery.mp3"));
Thread th = new Thread(() => _mediaPlayer("Voice\\SatFixLost.mp3"));
th.Start();
_bVoiceSatFixActive = true;
}
1839,6 → 1851,7
});
Dispatcher.Invoke(() => dgvWP.Items.Refresh());
Dispatcher.Invoke(() => _iWPIndex = data[1]);
if ((int)dr[1] == 0)
wpList.Add(new PointLatLng((double)dr[3], (double)dr[4]));
if (data[1] == data[0])
{
2086,11 → 2099,15
}
void _getWP()
{
int iTimeout = 0;
_bGetWPCount = true;
_getpWP(1); //get the itemscount of wp
while (_bGetWPCount)
Thread.Sleep(100);
if (_iWPCount > 0)
while (_bGetWPCount & iTimeout < _iWPTimeout * 5)
{
Thread.Sleep(10);
iTimeout++;
}
if (_iWPCount > 0 & !_bGetWPCount)
_getWPList();
}
void _getWPList()
2110,6 → 2127,7
}
void _sendWPList()
{
int iTimeout = 0;
if (serialPortCtrl.Port.IsOpen)
{
byte[] bData = new byte[30];
2120,9 → 2138,14
serialStream.Write(bytes, 0, bytes.Length);
 
_iWPCount = -1;
while (_iWPCount == -1)
while (_iWPCount == -1 & iTimeout < _iWPTimeout * 5)
{
Thread.Sleep(10);
iTimeout++;
}
Dispatcher.Invoke(() => lblWPCount.Content = _iWPCount.ToString());
if (_iWPCount > -1)
{
 
int iVal;
double dVal;
2188,12 → 2211,24
serialStream.Write(bytes, 0, bytes.Length);
 
_iWPCount = -1;
while (_iWPCount == -1)
iTimeout = 0;
while (_iWPCount == -1 & iTimeout < _iWPTimeout * 5)
{
Thread.Sleep(10);
iTimeout++;
}
if (_iWPCount == -1)
{
Log(LogMsgType.Error, "Timeout while sending list!");
break;
}
Dispatcher.Invoke(() => lblWPCount.Content = _iWPCount.ToString());
}
}
else
Log(LogMsgType.Error, "Timeout while sending list!");
}
else
Log(LogMsgType.Error, "NOT CONNECTED!");
 
}
2977,7 → 3012,20
{
_readWPLFile();
}
private void btnClearWPList_Click(object sender, RoutedEventArgs e)
{
_clearMapMarkers(typeof(CustomMarkerWP));
wpList.Clear();
if (mRouteWP != null)
MainMap.Markers.Remove(mRouteWP);
dtWaypoints.Rows.Clear();
Dispatcher.Invoke(() => dgvWP.Items.Refresh());
Dispatcher.Invoke(() => lblWPIndex.Content = 0);
Dispatcher.Invoke(() => lblWPCount.Content = 0);
Dispatcher.Invoke(() => lblWPRouteDistance.Content = "0 m");
}
#endregion WP
 
#region GPX
private void checkBoxGPXLog_Click(object sender, RoutedEventArgs e)
{
3056,18 → 3104,7
{
_clearMapMarkers(typeof(GMapRoute));
}
void _clearMapMarkers(Type markerType)
{
for (int k = 0; k < MainMap.Markers.Count;)
{
GMapMarker p = MainMap.Markers[k];
if (p.GetType() == markerType | p.Shape.GetType() == markerType)
MainMap.Markers.Remove(p);
else
k++;
}
 
}
void _loadGPXLog()
{