本文整理汇总了C#中MissionPlanner.Controls.ProgressReporterDialogue类的典型用法代码示例。如果您正苦于以下问题:C# ProgressReporterDialogue类的具体用法?C# ProgressReporterDialogue怎么用?C# ProgressReporterDialogue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgressReporterDialogue类属于MissionPlanner.Controls命名空间,在下文中一共展示了ProgressReporterDialogue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: updateCheckMain
public static void updateCheckMain(ProgressReporterDialogue frmProgressReporter)
{
var t = Type.GetType("Mono.Runtime");
MONO = (t != null);
try
{
if (dobeta)
{
CheckMD5(frmProgressReporter, ConfigurationManager.AppSettings["BetaUpdateLocationMD5"].ToString());
}
else
{
CheckMD5(frmProgressReporter, ConfigurationManager.AppSettings["UpdateLocationMD5"].ToString());
}
var process = new Process();
string exePath = Path.GetDirectoryName(Application.ExecutablePath);
if (MONO)
{
process.StartInfo.FileName = "mono";
process.StartInfo.Arguments = " \"" + exePath + Path.DirectorySeparatorChar + "Updater.exe\"" + " \"" + Application.ExecutablePath + "\"";
}
else
{
process.StartInfo.FileName = exePath + Path.DirectorySeparatorChar + "Updater.exe";
process.StartInfo.Arguments = Application.ExecutablePath;
}
try
{
foreach (string newupdater in Directory.GetFiles(exePath, "Updater.exe*.new"))
{
File.Copy(newupdater, newupdater.Remove(newupdater.Length - 4), true);
File.Delete(newupdater);
}
}
catch (Exception ex)
{
log.Error("Exception during update", ex);
}
if (frmProgressReporter != null)
frmProgressReporter.UpdateProgressAndStatus(-1, "Starting Updater");
log.Info("Starting new process: " + process.StartInfo.FileName + " with " + process.StartInfo.Arguments);
process.Start();
log.Info("Quitting existing process");
frmProgressReporter.BeginInvoke((Action) delegate {
Application.Exit();
});
}
catch (Exception ex)
{
log.Error("Update Failed", ex);
CustomMessageBox.Show("Update Failed " + ex.Message);
}
}
开发者ID:tesidroni,项目名称:mp,代码行数:58,代码来源:Update.cs
示例2: StartCalibration
public void StartCalibration()
{
Controls.ProgressReporterDialogue prd = new Controls.ProgressReporterDialogue()
{
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen,
Text = "Compass Mot"
};
prd.DoWork += DoCalibration;
prd.RunBackgroundOperationAsync();
}
开发者ID:GCBrentA,项目名称:MissionPlanner,代码行数:12,代码来源:MagMotor.cs
示例3: Firmware_Load
internal void Firmware_Load(object sender, EventArgs e)
{
pdr = new ProgressReporterDialogue();
pdr.DoWork -= pdr_DoWork;
pdr.DoWork += pdr_DoWork;
ThemeManager.ApplyThemeTo(pdr);
pdr.RunBackgroundOperationAsync();
}
开发者ID:GCBrentA,项目名称:MissionPlanner,代码行数:12,代码来源:ConfigFirmware.cs
示例4: UpdateFWList
void UpdateFWList()
{
pdr = new ProgressReporterDialogue();
pdr.DoWork -= pdr_DoWork;
pdr.DoWork += pdr_DoWork;
ThemeManager.ApplyThemeTo(pdr);
pdr.RunBackgroundOperationAsync();
}
开发者ID:UAVSOLUTIONS,项目名称:MissionPlanner-Current-Stable,代码行数:13,代码来源:ConfigFirmware.cs
示例5: doUI
void doUI(string inputfn, string outputfn, bool showui = true)
{
this.inputfn = inputfn;
this.outputfn = outputfn;
prd = new ProgressReporterDialogue();
prd.DoWork += prd_DoWork;
prd.UpdateProgressAndStatus(-1, Strings.Converting_bin_to_log);
this.convertstatus += BinaryLog_convertstatus;
ThemeManager.ApplyThemeTo(prd);
prd.RunBackgroundOperationAsync();
prd.Dispose();
}
开发者ID:duyisu,项目名称:MissionPlanner,代码行数:19,代码来源:BinaryLog.cs
示例6: metroDMButton1_Click
private void metroDMButton1_Click(object sender, EventArgs e)
{
//if ((altmode)CMB_altmode.SelectedValue == altmode.Absolute)
//{
// if (DialogResult.No == CustomMessageBox.Show("Absolute Alt is selected are you sure?", "Alt Mode", MessageBoxButtons.YesNo))
// {
// CMB_altmode.SelectedValue = (int)altmode.Relative;
// }
//}
// check for invalid grid data
for (int a = 0; a < Commands.Rows.Count - 0; a++)
{
for (int b = 0; b < Commands.ColumnCount - 0; b++)
{
double answer;
if (b >= 1 && b <= 7)
{
if (!double.TryParse(Commands[b, a].Value.ToString(), out answer))
{
CustomMessageBox.Show("There are errors in your mission");
return;
}
}
if (TXT_altwarn.Text == "")
TXT_altwarn.Text = (0).ToString();
if (Commands.Rows[a].Cells[Command.Index].Value.ToString().Contains("UNKNOWN"))
continue;
byte cmd = (byte)(int)Enum.Parse(typeof(MAVLink.MAV_CMD), Commands.Rows[a].Cells[Command.Index].Value.ToString(), false);
if (cmd < (byte)MAVLink.MAV_CMD.LAST && double.Parse(Commands[Alt.Index, a].Value.ToString()) < double.Parse(TXT_altwarn.Text))
{
if (cmd != (byte)MAVLink.MAV_CMD.TAKEOFF &&
cmd != (byte)MAVLink.MAV_CMD.LAND &&
cmd != (byte)MAVLink.MAV_CMD.RETURN_TO_LAUNCH)
{
CustomMessageBox.Show("Low alt on WP#" + (a + 1) + "\nPlease reduce the alt warning, or increase the altitude");
return;
}
}
}
}
ProgressReporterDialogue frmProgressReporter = new ProgressReporterDialogue
{
StartPosition = FormStartPosition.CenterScreen,
Text = "上传航点中"
};
frmProgressReporter.DoWork += saveWPs;
frmProgressReporter.UpdateProgressAndStatus(-1, "上传航点中");
//ThemeManager.ApplyThemeTo(frmProgressReporter);
frmProgressReporter.RunBackgroundOperationAsync();
frmProgressReporter.Dispose();
gMapControl1.Focus();
}
开发者ID:kkouer,项目名称:PcGcs,代码行数:63,代码来源:GCSMainForm.cs
示例7: WizardValidate
public int WizardValidate()
{
comport = CMB_port.Text;
if (comport == "")
{
CustomMessageBox.Show("Please select a comport", "error");
return 0;
}
if (!fwdone)
{
pdr = new ProgressReporterDialogue();
pdr.DoWork += pdr_DoWork;
ThemeManager.ApplyThemeTo(pdr);
pdr.RunBackgroundOperationAsync();
if (pdr.doWorkArgs.CancelRequested || !string.IsNullOrEmpty(pdr.doWorkArgs.ErrorMessage))
return 0;
}
if (MainV2.comPort.BaseStream.IsOpen)
MainV2.comPort.BaseStream.Close();
// setup for over usb
MainV2.comPort.BaseStream.BaudRate = 115200;
MainV2.comPort.BaseStream.PortName = comport;
MainV2.comPort.Open(true);
// try again
if (!MainV2.comPort.BaseStream.IsOpen)
{
CustomMessageBox.Show("Error connecting. Please unplug, plug back in, wait 10 seconds, and click OK","Try Again");
MainV2.comPort.Open(true);
}
if (!MainV2.comPort.BaseStream.IsOpen)
return 0;
if (string.IsNullOrEmpty(pdr.doWorkArgs.ErrorMessage))
{
if (Wizard.config["fwtype"].ToString() == "copter")
// check if its a quad, and show the frame type screen
return 1;
if (Wizard.config["fwtype"].ToString() == "rover")
// check if its a rover, and show the compass cal screen - skip accel
return 3;
else
// skip the frame type screen as its not valid for anythine else
return 2;
}
return 0;
}
开发者ID:digitalcraft,项目名称:MissionPlanner,代码行数:58,代码来源:3ConnectAP.cs
示例8: getImage
/*
public Bitmap getImage()
{
MemoryStream ms = new MemoryStream();
}
*/
public void getParamList()
{
frmProgressReporter = new ProgressReporterDialogue
{
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen,
Text = Strings.GettingParams + " " + sysidcurrent
};
frmProgressReporter.DoWork += FrmProgressReporterGetParams;
frmProgressReporter.UpdateProgressAndStatus(-1, Strings.GettingParamsD);
ThemeManager.ApplyThemeTo(frmProgressReporter);
frmProgressReporter.RunBackgroundOperationAsync();
frmProgressReporter.Dispose();
if (ParamListChanged != null)
{
ParamListChanged(this, null);
}
// nan check
foreach (string item in MAV.param.Keys)
{
if (float.IsNaN((float)MAV.param[item]))
CustomMessageBox.Show("BAD PARAM, " + item + " = NAN \n Fix this NOW!!", Strings.ERROR);
}
}
开发者ID:munaclaw,项目名称:MissionPlanner,代码行数:35,代码来源:MAVLinkInterface.cs
示例9: BUT_MagCalibration_Click
private void BUT_MagCalibration_Click(object sender, EventArgs e)
{
if (!MainV2.comPort.BaseStream.IsOpen)
{
CustomMessageBox.Show("You are no longer connected to the board\n the wizard will now exit","Error");
Wizard.instance.Close();
}
MainV2.comPort.MAV.cs.ratesensors = 2;
MainV2.comPort.requestDatastream(MAVLink.MAV_DATA_STREAM.EXTRA3, MainV2.comPort.MAV.cs.ratesensors);
MainV2.comPort.requestDatastream(MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.comPort.MAV.cs.ratesensors);
MainV2.comPort.setParam("MAG_ENABLE", 1);
CustomMessageBox.Show("Data will be collected for 60 seconds, Please click ok and move the apm around all axises");
ProgressReporterDialogue prd = new ProgressReporterDialogue();
Utilities.ThemeManager.ApplyThemeTo(prd);
prd.DoWork += prd_DoWork;
prd.RunBackgroundOperationAsync();
if (ans != null)
MagCalib.SaveOffsets(ans);
}
开发者ID:jchevin,项目名称:MissionPlanner-master,代码行数:28,代码来源:6CompassCalib.cs
示例10: button9_Click
private void button9_Click(object sender, EventArgs e)
{
if (Commands.Rows.Count > 0)
{
if (CustomMessageBox.Show("将覆盖本地航点,是否继续?", "确定", MessageBoxButtons.OKCancel) != DialogResult.OK)
{
return;
}
}
ProgressReporterDialogue frmProgressReporter = new ProgressReporterDialogue
{
StartPosition = FormStartPosition.CenterScreen,
Text = "下载航点"
};
frmProgressReporter.DoWork += getWPs;
frmProgressReporter.UpdateProgressAndStatus(-1, "下载航点");
frmProgressReporter.RunBackgroundOperationAsync();
frmProgressReporter.Dispose();
}
开发者ID:kkouer,项目名称:PcGcs,代码行数:24,代码来源:GCS.cs
示例11: Open
public void Open(bool getparams)
{
if (BaseStream.IsOpen)
return;
frmProgressReporter = new ProgressReporterDialogue
{
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen,
Text = "Connecting Mavlink"
};
if (getparams)
{
frmProgressReporter.DoWork += FrmProgressReporterDoWorkAndParams;
}
else
{
frmProgressReporter.DoWork += FrmProgressReporterDoWorkNOParams;
}
frmProgressReporter.UpdateProgressAndStatus(-1, "Mavlink Connecting...");
ThemeManager.ApplyThemeTo(frmProgressReporter);
frmProgressReporter.RunBackgroundOperationAsync();
if (ParamListChanged != null)
{
ParamListChanged(this, null);
}
}
开发者ID:pandagxnu,项目名称:MissionPlanner,代码行数:29,代码来源:MAVLink.cs
示例12: Open
public void Open(bool getparams, bool skipconnectedcheck = false)
{
if (BaseStream.IsOpen && !skipconnectedcheck)
return;
MAVlist.Clear();
frmProgressReporter = new ProgressReporterDialogue
{
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen,
Text = Strings.ConnectingMavlink
};
if (getparams)
{
frmProgressReporter.DoWork += FrmProgressReporterDoWorkAndParams;
}
else
{
frmProgressReporter.DoWork += FrmProgressReporterDoWorkNOParams;
}
frmProgressReporter.UpdateProgressAndStatus(-1, Strings.MavlinkConnecting);
ThemeManager.ApplyThemeTo(frmProgressReporter);
frmProgressReporter.RunBackgroundOperationAsync();
frmProgressReporter.Dispose();
if (ParamListChanged != null)
{
ParamListChanged(this, null);
}
}
开发者ID:ChukRhodes,项目名称:MissionPlanner,代码行数:33,代码来源:MAVLinkInterface.cs
示例13: Open
public void Open()
{
if (client.Client.Connected)
{
log.Info("udpserial socket already open");
return;
}
ProgressReporterDialogue frmProgressReporter = new ProgressReporterDialogue
{
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen,
Text = "Connecting Mavlink UDP"
};
frmProgressReporter.DoWork += frmProgressReporter_DoWork;
frmProgressReporter.UpdateProgressAndStatus(-1, "Connecting Mavlink UDP");
frmProgressReporter.RunBackgroundOperationAsync();
}
开发者ID:RealTadango,项目名称:MissionPlanner,代码行数:20,代码来源:CommsUdpSerial.cs
示例14: DoUpdate
public static void DoUpdate()
{
ProgressReporterDialogue frmProgressReporter = new ProgressReporterDialogue()
{
Text = "Check for Updates",
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
};
ThemeManager.ApplyThemeTo(frmProgressReporter);
frmProgressReporter.DoWork += new ProgressReporterDialogue.DoWorkEventHandler(DoUpdateWorker_DoWork);
frmProgressReporter.UpdateProgressAndStatus(-1, "Checking for Updates");
frmProgressReporter.RunBackgroundOperationAsync();
}
开发者ID:handihomann,项目名称:MissionPlanner,代码行数:16,代码来源:Update.cs
示例15: GetNewFile
static void GetNewFile(ProgressReporterDialogue frmProgressReporter, string baseurl, string subdir, string file)
{
// create dest dir
string dir = Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + subdir;
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
// get dest path
string path = Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + subdir + file;
Exception fail = null;
int attempt = 0;
// attempt to get file
while (attempt < 2)
{
// check if user canceled
if (frmProgressReporter.doWorkArgs.CancelRequested)
{
frmProgressReporter.doWorkArgs.CancelAcknowledged = true;
throw new Exception("Cancel");
}
try
{
// Create a request using a URL that can receive a post.
WebRequest request = WebRequest.Create(baseurl + file);
log.Info("get " + baseurl + file + " ");
// Set the Method property of the request to GET.
request.Method = "GET";
// Allow compressed content
((HttpWebRequest)request).AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
// tell server we allow compress content
request.Headers.Add("Accept-Encoding", "gzip,deflate");
// Get the response.
WebResponse response = request.GetResponse();
// Display the status.
log.Info(((HttpWebResponse)response).StatusDescription);
// Get the stream containing content returned by the server.
Stream dataStream = response.GetResponseStream();
// update status
if (frmProgressReporter != null)
frmProgressReporter.UpdateProgressAndStatus(-1, "Getting " + file);
// from head
long bytes = response.ContentLength;
long contlen = bytes;
byte[] buf1 = new byte[4096];
// if the file doesnt exist. just save it inplace
string fn = path + ".new";
if (!File.Exists(path))
fn = path;
using (FileStream fs = new FileStream(fn, FileMode.Create))
{
DateTime dt = DateTime.Now;
while (dataStream.CanRead)
{
try
{
if (dt.Second != DateTime.Now.Second)
{
if (frmProgressReporter != null)
frmProgressReporter.UpdateProgressAndStatus((int)(((double)(contlen - bytes) / (double)contlen) * 100), "Getting " + file + ": " + (((double)(contlen - bytes) / (double)contlen) * 100).ToString("0.0") + "%"); //+ Math.Abs(bytes) + " bytes");
dt = DateTime.Now;
}
}
catch { }
log.Debug(file + " " + bytes);
int len = dataStream.Read(buf1, 0, buf1.Length);
if (len == 0)
break;
bytes -= len;
fs.Write(buf1, 0, len);
}
fs.Close();
}
response.Close();
}
catch (Exception ex) { fail = ex; attempt++; continue; }
// break if we have no exception
break;
}
if (attempt == 2)
{
throw fail;
}
}
开发者ID:handihomann,项目名称:MissionPlanner,代码行数:100,代码来源:Update.cs
示例16: BUT_MagCalibration_Click
private void BUT_MagCalibration_Click(object sender, EventArgs e)
{
CustomMessageBox.Show("Data will be collected for 60 seconds, Please click ok and move the apm around all axises");
ProgressReporterDialogue prd = new ProgressReporterDialogue();
Utilities.ThemeManager.ApplyThemeTo(prd);
prd.DoWork += prd_DoWork;
prd.RunBackgroundOperationAsync();
if (ans != null)
MagCalib.SaveOffsets(ans);
}
开发者ID:LeoTosti,项目名称:x-drone,代码行数:15,代码来源:ConfigHWCompass.cs
示例17: CheckMD5
static async void CheckMD5(ProgressReporterDialogue frmProgressReporter, string url)
{
var baseurl = ConfigurationManager.AppSettings["UpdateLocation"];
if (dobeta)
{
baseurl = ConfigurationManager.AppSettings["BetaUpdateLocation"];
}
L10N.ReplaceMirrorUrl(ref baseurl);
string responseFromServer = "";
WebRequest request = WebRequest.Create(url);
request.Timeout = 10000;
// Set the Method property of the request to POST.
request.Method = "GET";
// Get the response.
// Get the stream containing content returned by the server.
// Open the stream using a StreamReader for easy access.
using (WebResponse response = request.GetResponse())
using (Stream dataStream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(dataStream))
{
// Display the status.
log.Info(((HttpWebResponse) response).StatusDescription);
// Read the content.
responseFromServer = reader.ReadToEnd();
}
Regex regex = new Regex(@"([^\s]+)\s+upgrade/(.*)", RegexOptions.IgnoreCase);
if (regex.IsMatch(responseFromServer))
{
List<Tuple<string, string, Task<bool>>> tasklist = new List<Tuple<string, string, Task<bool>>>();
MatchCollection matchs = regex.Matches(responseFromServer);
for (int i = 0; i < matchs.Count; i++)
{
string hash = matchs[i].Groups[1].Value.ToString();
string file = matchs[i].Groups[2].Value.ToString();
Task<bool> ismatch = MD5File(file, hash);
tasklist.Add(new Tuple<string,string, Task<bool>>(file, hash, ismatch));
}
log.Info("MD5File Running");
foreach (var task in tasklist)
{
string file = task.Item1;
string hash = task.Item2;
// check if existing matchs hash
bool match = await task.Item3;
if (!match)
{
log.Info("Newer File " + file);
// check is we have already downloaded and matchs hash
if (!MD5File(file + ".new", hash).Result)
{
if (frmProgressReporter != null)
frmProgressReporter.UpdateProgressAndStatus(-1, Strings.Getting + file);
string subdir = Path.GetDirectoryName(file) + Path.DirectorySeparatorChar;
GetNewFile(frmProgressReporter, baseurl + subdir.Replace('\\', '/'), subdir,
Path.GetFileName(file));
// check the new downloaded file matchs hash
if (!MD5File(file + ".new", hash).Result)
{
throw new Exception("File downloaded does not match hash: " + file);
}
}
else
{
log.Info("already got new File " + file);
}
}
else
{
log.Info("Same File " + file);
if (frmProgressReporter != null)
frmProgressReporter.UpdateProgressAndStatus(-1, Strings.Checking + file);
}
}
}
}
开发者ID:webclock,项目名称:MissionPlanner,代码行数:91,代码来源:Update.cs
示例18: BUT_MagCalibration_Click
private void BUT_MagCalibration_Click(object sender, EventArgs e)
{
MainV2.comPort.MAV.cs.ratesensors = 2;
MainV2.comPort.requestDatastream(MAVLink.MAV_DATA_STREAM.EXTRA3, MainV2.comPort.MAV.cs.ratesensors);
MainV2.comPort.requestDatastream(MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.comPort.MAV.cs.ratesensors);
MainV2.comPort.setParam("MAG_ENABLE", 1);
CustomMessageBox.Show("Data will be collected for 60 seconds, Please click ok and move the apm around all axises");
ProgressReporterDialogue prd = new ProgressReporterDialogue();
Utilities.ThemeManager.ApplyThemeTo(prd);
prd.DoWork += prd_DoWork;
prd.RunBackgroundOperationAsync();
}
开发者ID:RealTadango,项目名称:MissionPlanner,代码行数:19,代码来源:6CompassCalib.cs
示例19: DoUpdate
public static void DoUpdate()
{
if (Program.WindowsStoreApp)
{
CustomMessageBox.Show(Strings.Not_available_when_used_as_a_windows_store_app);
return;
}
ProgressReporterDialogue frmProgressReporter = new ProgressReporterDialogue()
{
Text = "Check for Updates",
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
};
ThemeManager.ApplyThemeTo(frmProgressReporter);
frmProgressReporter.DoWork += new ProgressReporterDialogue.DoWorkEventHandler(DoUpdateWorker_DoWork);
frmProgressReporter.UpdateProgressAndStatus(-1, "Checking for Updates");
frmProgressReporter.RunBackgroundOperationAsync();
frmProgressReporter.Dispose();
}
开发者ID:ArduPilot,项目名称:MissionPlanner,代码行数:24,代码来源:Update.cs
示例20: Open
public void Open()
{
if (client.Client.Connected)
{
log.Info("udpserial socket already open");
return;
}
client.Close();
string dest = Port;
dest = OnSettings("UDP_port", dest);
if (System.Windows.Forms.DialogResult.Cancel == InputBox.Show("Listern Port", "Enter Local port (ensure remote end is already sending)", ref dest))
{
return;
}
Port = dest;
OnSettings("UDP_port", Port, true);
ProgressReporterDialogue frmProgressReporter = new ProgressReporterDialogue
{
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen,
Text = "Connecting UDP"
};
ApplyThemeTo(frmProgressReporter);
frmProgressReporter.DoWork += frmProgressReporter_DoWork;
frmProgressReporter.UpdateProgressAndStatus(-1, "Connecting UDP");
frmProgressReporter.RunBackgroundOperationAsync();
frmProgressReporter.Dispose();
}
开发者ID:ArduPilot,项目名称:MissionPlanner,代码行数:38,代码来源:CommsUdpSerial.cs
注:本文中的MissionPlanner.Controls.ProgressReporterDialogue类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论