Skip to content

Commit

Permalink
Improved launcher and added bullet physics button.
Browse files Browse the repository at this point in the history
The launcher code is improved and it doesn't have the bug where when you
open it without wifi it thinks there's an update available.  Also added
a button that launches the bullet physics build.


Former-commit-id: 24b5893
  • Loading branch information
MackinnonBuck committed Jan 11, 2017
1 parent b94cb74 commit 322cd2a
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 137 deletions.
11 changes: 10 additions & 1 deletion launcher/Form1.Designer.cs → launcher/LaunchForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 35 additions & 91 deletions launcher/Form1.cs → launcher/LaunchForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace SynthesisLauncher
{
public partial class LaunchForm : Form
{
const String buildCurrent = "3.1.0.0";
const String buildCurrent = "3.1.1.0";
string exePath = Application.StartupPath;
public LaunchForm()
{
Expand All @@ -36,141 +36,92 @@ private void closeToolStripMenuItem_Click(object sender, EventArgs e)

private void synthesis_Click(object sender, EventArgs e)
{
//Do button stuff
String exc = null;
logText("Starting Synthesis...");

try {
try
{
Process.Start(exePath + "\\Synthesis\\Synthesis.exe");
logText("Synthesis Started!");
}
catch (Exception f)
catch
{
exc = f.ToString();
logText("Failed to start Synthesis!" + "\n Please report this: \n" + exc);
MessageBox.Show(this, "Couldn't start Synthesis!");
}

this.Focus();
Focus();
}

private void synthesisBulletButton_Click(object sender, EventArgs e)
{
try
{
Process.Start(exePath + "\\Synthesis\\Synthesis_Bullet.exe");
}
catch
{
MessageBox.Show(this, "Couldn't start Synthesis with Bullet Physics!");
}
}

public void updateStream()
{
string streamResults = "Changes in " + buildCurrent +": \n -Improved how PhysX collisions Interact in Simulator \n -Added a Driver Practice mode \n -Greatly Improved the UI \n -Added a New Launcher";
string streamResults = "Changes in " + buildCurrent +": \n -Added experimental simulator using Bullet Physics";
liveUpdater.Text = streamResults;
string currentBuild = getCurrentBuild();
string build = Page_Load();

buildLabel.Text = buildCurrent;

buildLabel.Text = currentBuild;

if (build == null)
return;

if ((currentBuild == build) && currentBuild != null)
if (buildCurrent.Equals(build))
{
//write loop with stream reader to read all of the info from the text changelog
buildLabel.Text = currentBuild;
buildLabel.Text = buildCurrent;
}
else if(((currentBuild != build) && currentBuild != null))
else
{
DialogResult dialogResult = MessageBox.Show("There is an update for this product, would you like to download it?", "Update avaliable", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
//do something
Process.Start("http://bxd.autodesk.com/Downloadables/SynthesisBetaInstaller.exe");
System.Environment.Exit(1);

}
else if (dialogResult == DialogResult.No)
{
//do something else
}
}
else if(((currentBuild != build) && currentBuild == null))
{
//User needs a new manifest file because their's is missing or missplaced
liveUpdater.Text = "Cannot locate your local manifest file which details information about the current build version of Autodesk Synthesis. \nPlease report this to [email protected]";
}
else
{
MessageBox.Show("An error has occured while trying to connect to Autodesk Servers!");
}

}

public void logText(string text)
{
//for debug purposes
//TextDisplay.Text = text + "\n" + TextDisplay.Text;
}

private void rExporter_Click(object sender, EventArgs e)
{
String exc = null;
logText("Starting Robot Exporter...");

try
{
Process.Start(exePath + "\\RobotExporter\\Inventor_Exporter.exe");
logText("Robot Exporter Started!");
}
catch (Exception f)
catch
{
exc = f.ToString();
logText("Failed to start the Robot exporter!" + "\n Please report this: \n" + exc);
MessageBox.Show(this, "Failed to start the Robot exporter!");
}
}

private void fExporter_Click(object sender, EventArgs e)
{
String exc = null;
logText("Starting Field Exporter...");

try
{
Process.Start(exePath + "\\FieldExporter\\FieldExporter.exe");
logText("Field Exporter Started!");
}
catch (Exception f)
catch
{
exc = f.ToString();
logText("Failed to start the field exporter!" + "\n Please report this: \n" + exc);
MessageBox.Show(this, "Failed to start the field exporter!");
}
}

private void codeViewer_Click(object sender, EventArgs e)
{
String exc = null;
logText("Starting Code Viewer...");
//logText(exePath);
try
{
Process.Start(exePath + "\\SynthesisDrive\\SynthesisDriver.exe");
//logText(exePath);
logText("Code Viewer Started!");
}
catch (Exception f)
{
exc = f.ToString();
//logText("Failed to start the Code Viewer!" + "\n Please report this: \n" + exc);
}
}

public string getCurrentBuild()
{
return buildCurrent;
/*
try {
string line = File.ReadAllText(@"../../Resources/Manifest.txt");
string[] words = line.Split(' ');
string buildVersion = words[2];
//ResXResourceWriter resx = new ResXResourceWriter(@".\CarResources.resx");
//ResXResourceReader resx = new ResXResourceReader("Resources.resx");
Console.WriteLine(buildVersion);
return buildVersion;
}catch (Exception e)
catch
{
logText("Could not read Manifest file!");
return "error";
MessageBox.Show(this, "Failed to start the Code Viewer!");
}
*/
}

public string Page_Load()
Expand All @@ -182,16 +133,14 @@ public string Page_Load()
{
String line = reader.ReadToEnd();
string[] words = line.Split(' ');
logText("Connection to update server successful!" + "\n" + "Current Release Build Number is " + words[2]);
return words[2];
}
}catch(Exception e)
}
catch
{
logText("Connection to the remote server for a update was not successful!");
MessageBox.Show(this, "Connection to the remote server for a update was not successful!");
return null;
}
//string userscore = doc.DocumentNode.SelectNodes("//*[@id=\"main\"]/div[3]/div/div[2]/div[1]/div[2]/div[1]/div/div[2]/a/span[1]")[0].InnerText;
//string summary = doc.DocumentNode.SelectNodes("//*[@id=\"main\"]/div[3]/div/div[2]/div[2]/div[1]/ul/li/span[2]/span/span[1]")[0].InnerText;
}

private void robotExportToolStripMenuItem_Click(object sender, EventArgs e)
Expand All @@ -218,10 +167,5 @@ private void driverstationToolStripMenuItem_Click(object sender, EventArgs e)
{
Process.Start("http://bxd.autodesk.com/?page=tutorialDriverStation");
}

private void fileToolStripMenuItem_Click(object sender, EventArgs e)
{

}
}
}
File renamed without changes.
Loading

0 comments on commit 322cd2a

Please sign in to comment.