Skip to content

Commit

Permalink
Mission Planner 1.2.90
Browse files Browse the repository at this point in the history
new df over mavlink
fix grid advanced button
remove arduino verbose logging
update mavlink headers (df over mavlink)
better error handling of bad log lines in DF log
fix posible log dl issue
thread fw version download
  • Loading branch information
meee1 committed Dec 18, 2013
1 parent 2e6989c commit 36a949f
Show file tree
Hide file tree
Showing 21 changed files with 3,487 additions and 2,886 deletions.
4 changes: 2 additions & 2 deletions Arduino/ArduinoSTKv2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public bool uploadflash(byte[] data, int startfrom, int length, int startaddress

byte[] command = new byte[] { (byte)0x13, (byte)(sending >> 8), (byte)(sending & 0xff) };

log.InfoFormat((startfrom + (length - totalleft)) + " - " + sending);
//log.InfoFormat((startfrom + (length - totalleft)) + " - " + sending);

Array.Resize<byte>(ref command, sending + 10); // sending + head

Expand Down Expand Up @@ -293,7 +293,7 @@ public bool setaddress(int address)
throw new Exception("Address must be an even number");
}

log.InfoFormat("Sending address " + ((address / 2)));
//log.InfoFormat("Sending address " + ((address / 2)));

int tempstart = address / 2; // words
byte[] temp = new byte[] { 0x6, (byte)((tempstart >> 24) & 0xff), (byte)((tempstart >> 16) & 0xff), (byte)((tempstart >> 8) & 0xff), (byte)((tempstart >> 0) & 0xff) };
Expand Down
11 changes: 10 additions & 1 deletion ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
* Mission Planner 1.2.89
* Mission Planner 1.2.90
new df over mavlink
fix grid advanced button
remove arduino verbose logging
update mavlink headers (df over mavlink)
better error handling of bad log lines in DF log
fix posible log dl issue
thread fw version download

* Mission Planner 1.2.89
fix kml/gpx creation
log browser mod
df log renaming based on gps time
Expand Down
20 changes: 12 additions & 8 deletions ExtLibs/Comms/CommsSerialPort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,27 @@ protected override void Dispose(bool disposing)
{
Type mytype = typeof(System.IO.Ports.SerialPort);
FieldInfo field = mytype.GetField("internalSerialStream", BindingFlags.Instance | BindingFlags.NonPublic);
Stream stream = (Stream)field.GetValue(this);

if (stream != null)
if (field != null)
{
try
Stream stream = (Stream)field.GetValue(this);

if (stream != null)
{
stream.Dispose();
try
{
stream.Dispose();
}
catch (Exception ex) { Console.WriteLine("1 " + ex.ToString()); }
stream = null;
}
catch (Exception ex) { Console.WriteLine(ex.ToString()); }
stream = null;
}
}
catch (Exception ex) { Console.WriteLine(ex.ToString()); }
catch (Exception ex) { Console.WriteLine("2 " + ex.ToString()); }

base.Dispose(disposing);
}
catch (Exception ex) { Console.WriteLine(ex.ToString()); }
catch (Exception ex) { Console.WriteLine("3 " + ex.ToString()); }
}

public new void Open()
Expand Down
5 changes: 4 additions & 1 deletion ExtLibs/Grid/GridUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,12 @@ private void GridUI_Load(object sender, EventArgs e)

xmlcamera(false);

// setup state before settings load
CHK_advanced_CheckedChanged(null, null);

loadsettings();

CHK_advanced_CheckedChanged(null, null);
//CHK_advanced_CheckedChanged(null, null);
}

private void TXT_TextChanged(object sender, EventArgs e)
Expand Down
109 changes: 104 additions & 5 deletions ExtLibs/Mavlink/Csharp/ardupilotmega/mavlink.cs

Large diffs are not rendered by default.

109 changes: 104 additions & 5 deletions ExtLibs/Mavlink/Csharp/common/mavlink.cs

Large diffs are not rendered by default.

5,535 changes: 2,817 additions & 2,718 deletions ExtLibs/Mavlink/Mavlink.cs

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions ExtLibs/Mavlink/message_definitions/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,15 @@
<entry value="65536" name="MAV_SYS_STATUS_SENSOR_RC_RECEIVER">
<description>0x10000 rc receiver</description>
</entry>
<entry value="131072" name="MAV_SYS_STATUS_SENSOR_3D_GYRO2">
<description>0x20000 2nd 3D gyro</description>
</entry>
<entry value="262144" name="MAV_SYS_STATUS_SENSOR_3D_ACCEL2">
<description>0x40000 2nd 3D accelerometer</description>
</entry>
<entry value="524288" name="MAV_SYS_STATUS_SENSOR_3D_MAG2">
<description>0x80000 2nd 3D magnetometer</description>
</entry>
</enum>
<enum name="MAV_FRAME">
<entry value="0" name="MAV_FRAME_GLOBAL">
Expand Down Expand Up @@ -1775,6 +1784,46 @@
<field type="int16_t" name="ymag">Y Magnetic field (milli tesla)</field>
<field type="int16_t" name="zmag">Z Magnetic field (milli tesla)</field>
</message>
<message id="117" name="LOG_REQUEST_LIST">
<description>Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called.</description>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
<field type="uint16_t" name="start">First log id (0 for first available)</field>
<field type="uint16_t" name="end">Last log id (0xffff for last available)</field>
</message>
<message id="118" name="LOG_ENTRY">
<description>Reply to LOG_REQUEST_LIST</description>
<field type="uint16_t" name="id">Log id</field>
<field type="uint16_t" name="num_logs">Total number of logs</field>
<field type="uint16_t" name="last_log_num">High log number</field>
<field type="uint32_t" name="time_utc">UTC timestamp of log in seconds since 1970, or 0 if not available</field>
<field type="uint32_t" name="size">Size of the log (may be approximate) in bytes</field>
</message>
<message id="119" name="LOG_REQUEST_DATA">
<description>Request a chunk of a log</description>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
<field type="uint16_t" name="id">Log id (from LOG_ENTRY reply)</field>
<field type="uint32_t" name="ofs">Offset into the log</field>
<field type="uint32_t" name="count">Number of bytes</field>
</message>
<message id="120" name="LOG_DATA">
<description>Reply to LOG_REQUEST_DATA</description>
<field type="uint16_t" name="id">Log id (from LOG_ENTRY reply)</field>
<field type="uint32_t" name="ofs">Offset into the log</field>
<field type="uint8_t" name="count">Number of bytes (zero for end of log)</field>
<field type="uint8_t[90]" name="data">log data</field>
</message>
<message id="121" name="LOG_ERASE">
<description>Erase all logs</description>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
</message>
<message id="122" name="LOG_REQUEST_END">
<description>Stop log transfer and resume normal logging</description>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
</message>
<message id="147" name="BATTERY_STATUS">
<description>Transmitte battery informations for a accu pack.</description>
<field type="uint8_t" name="accu_id">Accupack ID</field>
Expand Down
2 changes: 2 additions & 0 deletions GCSViews/Terminal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ private void start_Terminal(bool px4)

comPort.Open();

log.Info("toggle dtr");

comPort.toggleDTR();
}

Expand Down
89 changes: 45 additions & 44 deletions Log/BinaryLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,62 +40,63 @@ public static List<string> ReadLog(string fn)
{
List<string> lines = new List<string>();

BinaryReader br = new BinaryReader(File.OpenRead(fn));

int log_step = 0;

while (br.BaseStream.Position < br.BaseStream.Length)
using (BinaryReader br = new BinaryReader(File.OpenRead(fn)))
{
byte data = br.ReadByte();
int log_step = 0;

switch (log_step)
while (br.BaseStream.Position < br.BaseStream.Length)
{
case 0:
if (data == HEAD_BYTE1)
{
log_step++;
}
break;
byte data = br.ReadByte();

case 1:
if (data == HEAD_BYTE2)
{
log_step++;
}
else
{
log_step = 0;
}
break;

case 2:
log_step = 0;
try
{
string line = logEntry(data, br);

// we need to know the mav type to use the correct mode list.
if (line.Contains("PARM, RATE_RLL_P"))
switch (log_step)
{
case 0:
if (data == HEAD_BYTE1)
{
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduCopter2;
log_step++;
}
else if ((line.Contains("PARM, H_SWASH_PLATE")))
break;

case 1:
if (data == HEAD_BYTE2)
{
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduCopter2;
log_step++;
}
else if (line.Contains("PARM, PTCH2SRV_P"))
else
{
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduPlane;
log_step = 0;
}
else if (line.Contains("PARM, SKID_STEER_OUT"))
break;

case 2:
log_step = 0;
try
{
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduRover;
string line = logEntry(data, br);

// we need to know the mav type to use the correct mode list.
if (line.Contains("PARM, RATE_RLL_P"))
{
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduCopter2;
}
else if ((line.Contains("PARM, H_SWASH_PLATE")))
{
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduCopter2;
}
else if (line.Contains("PARM, PTCH2SRV_P"))
{
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduPlane;
}
else if (line.Contains("PARM, SKID_STEER_OUT"))
{
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduRover;
}

lines.Add(line);
}

lines.Add(line);
}
catch { Console.WriteLine("Bad Binary log line {0}", data); }
break;
catch { Console.WriteLine("Bad Binary log line {0}", data); }
break;
}
}
}

Expand Down
Loading

0 comments on commit 36a949f

Please sign in to comment.