Issue #2198 - created a launcher that would start both AlertViz and CAVE; no extra windows are created now

- Note: VizLauncher and AWIPSII.CAVE are NOT Eclipse projects.


Former-commit-id: c1c6cd087a493f052a66fbc6e7b608cd959f7905
This commit is contained in:
Bryan Kowal 2013-08-08 17:44:12 -05:00
parent 72a841bcd5
commit a1fccaa598
27 changed files with 1125 additions and 167 deletions

View file

@ -1,69 +0,0 @@
@echo OFF
REM Determine if we are running on a 32-bit or 64-bit OS.
IF NOT EXIST C:\Windows\SysWOW64\reg.exe (
SET REG_EXE=C:\Windows\System32\reg.exe
) ELSE (
SET REG_EXE=C:\Windows\SysWOW64\reg.exe
)
REM Determine where we are located.
SET CONTAINING_DIRECTORY=%~dp0
REM Prepare the environment.
REM Registry Query Variables.
SET A2_JAVA_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Java"
SET A2_PYTHON_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Python"
REM Determine where AWIPS II Java (the jre) is located.
%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory > NUL 2>&1
IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Java. && PAUSE && EXIT)
FOR /F "tokens=2* delims= " %%A IN (
'%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory') DO (
SET JavaJreDirectory=%%B)
REM Determine where AWIPS II Python is located.
%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory > NUL 2>&1
IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Python. && PAUSE && EXIT)
FOR /F "tokens=2* delims= " %%A IN (
'%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory') DO (
SET PythonInstallDirectory=%%B)
REM Add Java and Python to the path.
SET Path=%PythonInstallDirectory%;%PythonInstallDirectory%\DLLs;%Path%
SET Path=%JavaJreDirectory%\bin;%Path%
REM Define 'PythonPath'.
SET PythonPath=%PythonInstallDirectory%\Lib\lib-tk;%PythonPath%
SET PythonPath=%PythonInstallDirectory%\DLLs;%PythonPath%
SET PythonPath=%PythonInstallDirectory%\Lib;%PythonPath%
SET PythonPath=%PythonInstallDirectory%;%PythonPath%
REM Eliminate variables that will no longer be used.
SET PythonInstallDirectory=
SET JavaJreDirectory=
SET REG_EXE=
SET A2_JAVA_REG=
SET A2_PYTHON_REG=
REM Determine where we will be logging to.
SET HOME_DIRECTORY=%HOMEDRIVE%%HOMEPATH%
SET CAVEDATA_LOG_DIRECTORY=%HOMEDRIVE%%HOMEPATH%\caveData\logs
SET CONSOLE_LOG_DIRECTORY=%CAVEDATA_LOG_DIRECTORY%\consoleLogs\%COMPUTERNAME%
IF NOT EXIST "%CONSOLE_LOG_DIRECTORY%" (MKDIR "%CONSOLE_LOG_DIRECTORY%")
echo Starting ALERTVIZ; leave this CMD window open to enable AlertViz 'restart'.
REM Start AlertViz (and implement the alertviz restart capability).
:AlertVizLoopStart
SET RND=%random%
SET RND_DATETIME_FILE=%TMP%\awips2dt_%RND%.tmp
REM Python is used to retrieve the current date and time because the order
REM of the Windows date/time fields is not necessarily guaranteed and the
REM Windows date/time fields can only be extracted using substring operations
REM instead of -formatter- strings like Linux allows.
python -c "from datetime import datetime; print datetime.now().strftime('%%Y%%m%%d_%%H%%M%%S');" > %RND_DATETIME_FILE%
SET /p LOG_DATETIME= < %RND_DATETIME_FILE%
DEL %RND_DATETIME_FILE%
"%CONTAINING_DIRECTORY%alertviz.exe" %* > "%CONSOLE_LOG_DIRECTORY%\alertviz_%LOG_DATETIME%.log" 2>&1
IF %ERRORLEVEL% == 0 (EXIT)
echo Restarting AlertViz.
GOTO AlertVizLoopStart

View file

@ -1,72 +0,0 @@
@echo OFF
REM Determine if we are running on a 32-bit or 64-bit OS.
IF NOT EXIST C:\Windows\SysWOW64\reg.exe (
SET REG_EXE=C:\Windows\System32\reg.exe
) ELSE (
SET REG_EXE=C:\Windows\SysWOW64\reg.exe
)
REM Determine where we are located.
SET CONTAINING_DIRECTORY=%~dp0
REM Prepare the environment.
REM Registry Query Variables.
SET A2_JAVA_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Java"
SET A2_PYTHON_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Python"
REM Determine where AWIPS II Java (the jre) is located.
%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory > NUL 2>&1
IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Java. && PAUSE && EXIT)
FOR /F "tokens=2* delims= " %%A IN (
'%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory') DO (
SET JavaJreDirectory=%%B)
REM Determine where AWIPS II Python is located.
%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory > NUL 2>&1
IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Python. && PAUSE && EXIT)
FOR /F "tokens=2* delims= " %%A IN (
'%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory') DO (
SET PythonInstallDirectory=%%B)
REM Add Java and Python to the path.
SET Path=%PythonInstallDirectory%;%PythonInstallDirectory%\DLLs;%Path%
SET Path=%JavaJreDirectory%\bin;%Path%
REM Add the CAVE lib directory to the path.
SET Path=%CONTAINING_DIRECTORY%lib;%Path%
REM Define 'PythonPath'.
SET PythonPath=%CONTAINING_DIRECTORY%lib;%PythonPath%
SET PythonPath=%PythonInstallDirectory%\Lib\lib-tk;%PythonPath%
SET PythonPath=%PythonInstallDirectory%\DLLs;%PythonPath%
SET PythonPath=%PythonInstallDirectory%\Lib;%PythonPath%
SET PythonPath=%PythonInstallDirectory%;%PythonPath%
REM Eliminate variables that will no longer be used.
SET PythonInstallDirectory=
SET JavaJreDirectory=
SET REG_EXE=
SET A2_JAVA_REG=
SET A2_PYTHON_REG=
REM Determine where we will be logging to.
SET HOME_DIRECTORY=%HOMEDRIVE%%HOMEPATH%
SET CAVEDATA_LOG_DIRECTORY=%HOMEDRIVE%%HOMEPATH%\caveData\logs
SET CONSOLE_LOG_DIRECTORY=%CAVEDATA_LOG_DIRECTORY%\consoleLogs\%COMPUTERNAME%
IF NOT EXIST "%CONSOLE_LOG_DIRECTORY%" (MKDIR "%CONSOLE_LOG_DIRECTORY%")
SET RND=%random%
SET RND_DATETIME_FILE=%TMP%\awips2dt_%RND%.tmp
REM Python is used to retrieve the current date and time because the order
REM of the Windows date/time fields is not necessarily guaranteed and the
REM Windows date/time fields can only be extracted using substring operations
REM instead of -formatter- strings like Linux allows.
python -c "from datetime import datetime; print datetime.now().strftime('%%Y%%m%%d_%%H%%M%%S');" > %RND_DATETIME_FILE%
SET /p LOG_DATETIME= < %RND_DATETIME_FILE%
DEL %RND_DATETIME_FILE%
echo THIS CMD WINDOW CAN BE CLOSED AT ANY TIME!
cd %HOMEPATH%
REM Start CAVE.
"%CONTAINING_DIRECTORY%cave.exe" %* > "%CONSOLE_LOG_DIRECTORY%\cave_%LOG_DATETIME%.log" 2>&1
IF ERRORLEVEL 1 (echo CAVE ERROR - check the logs for additional information. && PAUSE)
EXIT

Binary file not shown.

View file

@ -24,30 +24,14 @@
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="INSTALLDIR" Name="Raytheon">
<Directory Id="AwipsII" Name="AWIPS II">
<Directory Id="CaveDir" Name="CAVE">
<Component Id="caveBatch" Guid="8924277C-5B6A-4EEB-AE9F-5471481F92A6">
<File Id="caveBAT" Name="cave.bat"
DiskId="1" Source="SourceDir\CAVE\cave.bat" />
<Shortcut Id="caveDesktopShortcut" Directory="DesktopFolder" Name="CAVE"
WorkingDirectory="CaveDir" Advertise="yes" Icon="cave.exe" IconIndex="0"
Arguments="-component thinclient" />
<Shortcut Id="caveStartMenu" Directory="ProgramMenuDir" Name="CAVE"
WorkingDirectory="CaveDir" Advertise="yes" Icon="cave.exe" IconIndex="0"
Arguments="-component thinclient" />
<Component Id="VizLauncherExe" Guid="8924277C-5B6A-4EEB-AE9F-5471481F92A6">
<File Id="VizLauncherExe" Name="VizLauncher.exe"
DiskId="1" Source="SourceDir\VizLauncher.exe" />
<Shortcut Id="vizLauncherDesktopShortcut" Directory="DesktopFolder" Name="Viz Launcher"
WorkingDirectory="SourceDir" Advertise="yes" Icon="cave.exe" IconIndex="0" />
<Shortcut Id="vizLauncherStartMenu" Directory="ProgramMenuDir" Name="Viz Launcher"
WorkingDirectory="SourceDir" Advertise="yes" Icon="cave.exe" IconIndex="0" />
</Component>
</Directory>
<Directory Id="AlertvizDir" Name="AlertViz">
<Component Id="alertvizBatch" Guid="8924277C-5B6A-4EEB-AE9F-5471481F92B4">
<File Id="alertvizBAT" Name="alertviz.bat"
DiskId="1" Source="SourceDir\AlertViz\alertviz.bat" />
<Shortcut Id="alertvizDesktopShortcut" Directory="DesktopFolder" Name="AlertViz"
WorkingDirectory="AlertvizDir" Advertise="yes" Icon="alertviz.exe" IconIndex="0"
Arguments="-component thinalertviz" />
<Shortcut Id="alertvizStartMenu" Directory="ProgramMenuDir" Name="AlertViz"
WorkingDirectory="AlertvizDir" Advertise="yes" Icon="alertviz.exe" IconIndex="0"
Arguments="-component thinalertviz" />
</Component>
</Directory>
</Directory>
</Directory>
@ -71,7 +55,6 @@
<Feature Id="AWIPS_II_CAVE" Title="AWIPS II CAVE" Level="1"
Display="expand" Description="AWIPS II Common AWIPS Visualization Environment (CAVE)"
ConfigurableDirectory="INSTALLDIR">
<ComponentRef Id="caveBatch" />
<ComponentRef Id="ProgramMenuDir" />
<ComponentGroupRef Id="AWIPSII_CAVE" />
@ -80,16 +63,20 @@
<Feature Id="AWIPS_II_ALERTVIZ" Title="AWIPS II AlertViz" Level="1"
Display="expand" Description="AWIPS II AlertViz"
ConfigurableDirectory="INSTALLDIR">
<ComponentRef Id="alertvizBatch" />
<ComponentGroupRef Id="AWIPSII_ALERTVIZ" />
</Feature>
<Feature Id="AWIPS_II_LAUNCHER" Title="AWIPS II Viz Launcher" Level="1"
Display="expand" Description="Viz Launcher - Starts both AlertViz and CAVE"
ConfigurableDirectory="INSTALLDIR">
<ComponentRef Id="VizLauncherExe" />
</Feature>
<UIRef Id="WixUI_FeatureTree" />
<UIRef Id="WixUI_ErrorProgressText" />
<Icon Id="cave.exe" SourceFile="SourceDir\CAVE\cave.exe" />
<Icon Id="alertviz.exe" SourceFile="SourceDir\AlertViz\alertviz.exe" />
</Product>
</Wix>

View file

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VizLauncher", "VizLauncher\VizLauncher.csproj", "{45B15612-0725-479C-8E1B-9B63F2FB45A3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{45B15612-0725-479C-8E1B-9B63F2FB45A3}.Debug|x86.ActiveCfg = Debug|x86
{45B15612-0725-479C-8E1B-9B63F2FB45A3}.Debug|x86.Build.0 = Debug|x86
{45B15612-0725-479C-8E1B-9B63F2FB45A3}.Release|x86.ActiveCfg = Release|x86
{45B15612-0725-479C-8E1B-9B63F2FB45A3}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View file

@ -0,0 +1,79 @@
namespace VizLauncher
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.lblFailureDetail = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(12, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(337, 50);
this.label1.TabIndex = 0;
this.label1.Text = "Failed to Start AWIPS II Viz!";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblFailureDetail
//
this.lblFailureDetail.BackColor = System.Drawing.Color.White;
this.lblFailureDetail.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblFailureDetail.Location = new System.Drawing.Point(14, 59);
this.lblFailureDetail.Name = "lblFailureDetail";
this.lblFailureDetail.Size = new System.Drawing.Size(335, 119);
this.lblFailureDetail.TabIndex = 1;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(361, 187);
this.Controls.Add(this.lblFailureDetail);
this.Controls.Add(this.label1);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Viz Launcher";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblFailureDetail;
}
}

View file

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace VizLauncher
{
public partial class Form1 : Form
{
public Form1(String errorText)
{
InitializeComponent();
this.lblFailureDetail.Text = errorText;
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using VizLauncher.com.raytheon.viz.launcher;
namespace VizLauncher
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
VizLauncher.com.raytheon.viz.launcher.VizLauncher vizLauncher =
new VizLauncher.com.raytheon.viz.launcher.VizLauncher();
bool success = vizLauncher.run(Application.StartupPath);
if (success == false)
{
// Display the "Failure" dialog.
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(vizLauncher.getErrorDetail()));
}
Application.Exit();
}
}
}

View file

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("VizLauncher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("VizLauncher")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7f929b46-b56e-47eb-b6e6-ff79e54f6572")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VizLauncher.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VizLauncher.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View file

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VizLauncher.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View file

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View file

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{45B15612-0725-479C-8E1B-9B63F2FB45A3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VizLauncher</RootNamespace>
<AssemblyName>VizLauncher</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="com\raytheon\viz\launcher\environment\EnvironmentProperties.cs" />
<Compile Include="com\raytheon\viz\launcher\environment\VizEnvironment.cs" />
<Compile Include="com\raytheon\viz\launcher\process\AbstractProcessLauncher.cs" />
<Compile Include="com\raytheon\viz\launcher\process\impl\AlertvizProcessLauncher.cs" />
<Compile Include="com\raytheon\viz\launcher\process\impl\CaveProcessLauncher.cs" />
<Compile Include="com\raytheon\viz\launcher\process\IProcessLauncher.cs" />
<Compile Include="com\raytheon\viz\launcher\VizLauncher.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View file

@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using VizLauncher.com.raytheon.viz.launcher.environment;
using VizLauncher.com.raytheon.viz.launcher.process;
using VizLauncher.com.raytheon.viz.launcher.process.impl;
namespace VizLauncher.com.raytheon.viz.launcher
{
public class VizLauncher
{
private String errorDetail;
public bool run(String location)
{
VizEnvironment vizEnvironment = new VizEnvironment(location);
if (vizEnvironment.isReady() == false)
{
this.errorDetail = vizEnvironment.getExceptionText();
return false;
}
/* Alternatively, we would be able to construct both process launchers using Spring and inject them. */
// Construct the AlertViz Process Launcher.
IProcessLauncher alertvizProcessLauncher = new AlertvizProcessLauncher(vizEnvironment);
if (alertvizProcessLauncher.isReady() == false)
{
this.errorDetail = alertvizProcessLauncher.getExceptionText();
return false;
}
Thread alertvizThread = new Thread(alertvizProcessLauncher.launchProcess);
// Construct the CAVE Process Launcher.
IProcessLauncher caveProcessLauncher = new CaveProcessLauncher(vizEnvironment);
if (caveProcessLauncher.isReady() == false)
{
this.errorDetail = caveProcessLauncher.getExceptionText();
return false;
}
Thread caveThread = new Thread(caveProcessLauncher.launchProcess);
// Start AlertViz.
alertvizThread.Start();
// Delay - Give Alertviz Time To Start.
Thread.Sleep(1000);
// Start CAVE.
caveThread.Start();
// Wait for CAVE.
caveThread.Join();
// Wait for AlertViz.
alertvizThread.Join();
return true;
}
public String getErrorDetail()
{
return this.errorDetail;
}
}
}

View file

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace VizLauncher.com.raytheon.viz.launcher.environment
{
public abstract class EnvironmentProperties
{
/* Environment Properties */
public static readonly String USER_HOME_ENV_PROPERTY = "%HOMEDRIVE%%HOMEPATH%";
public static readonly String COMPUTER_NAME_ENV_PROPERTY = "%COMPUTERNAME%";
/* Registry Constants */
public static readonly String A2_JAVA_REG = @"Software\Raytheon\Runtime Environment\AWIPS II Java";
public static readonly String A2_PYTHON_REG = @"Software\Raytheon\Runtime Environment\AWIPS II Python";
public static readonly String JAVA_JRE_VALUE_NAME = "JavaJreDirectory";
public static readonly String PYTHON_INSTALL_NAME = "PythonInstallDirectory";
/* Environment Additions */
public static readonly String ENVIRONMENT_VARIABLE_PATH = "Path";
public static readonly String ENVIRONMENT_VARIABLE_PYTHON_PATH = "PythonPath";
public static readonly String PATH_PYTHON_DLLS = Path.DirectorySeparatorChar + "DLLs";
public static readonly String PATH_JAVA_BIN = Path.DirectorySeparatorChar + "bin";
public static readonly String PYTHON_PATH_PYTHON_LIBTK =
Path.DirectorySeparatorChar + "Lib" + Path.DirectorySeparatorChar + "lib-tk";
public static readonly String PYTHON_PATH_PYTHON_DLLS = Path.DirectorySeparatorChar + "DLLs";
public static readonly String PYTHON_PATH_PYTHON_LIB = Path.DirectorySeparatorChar + "Lib";
}
}

View file

@ -0,0 +1,137 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.Win32;
namespace VizLauncher.com.raytheon.viz.launcher.environment
{
public class VizEnvironment
{
private static readonly String CONSOLE_LOGS_DIRECTORY =
Path.DirectorySeparatorChar + "caveData" + Path.DirectorySeparatorChar +
"logs" + Path.DirectorySeparatorChar + "consoleLogs";
private String location;
private String logDirectory = null;
private String path = null;
private String pythonPath = null;
// did an error occur while initializing this object?
private bool ready;
// details about the error that has occurred.
private String exceptionText;
public VizEnvironment(String location)
{
this.location = location;
this.init();
}
private void init()
{
/* For now we will assume that the environment properties will be available */
// determine the location of the user's "home" directory.
String homeDirectory =
this.resolveEnvironmentProperty(EnvironmentProperties.USER_HOME_ENV_PROPERTY);
// determine the computer name.
String computerName =
this.resolveEnvironmentProperty(EnvironmentProperties.COMPUTER_NAME_ENV_PROPERTY);
// construct the path to the log directory.
this.logDirectory = homeDirectory + CONSOLE_LOGS_DIRECTORY +
Path.DirectorySeparatorChar + computerName;
// retrieve the jdk directory from the registry.
String jdkDirectory =
this.retrieveRegistryProperty(EnvironmentProperties.A2_JAVA_REG,
EnvironmentProperties.JAVA_JRE_VALUE_NAME);
if (jdkDirectory == null)
{
this.notReady("Unable to retrieve the Java JDK Path from the registry!");
return;
}
// retrieve the python location from the registry.
String pythonLocation =
this.retrieveRegistryProperty(EnvironmentProperties.A2_PYTHON_REG,
EnvironmentProperties.PYTHON_INSTALL_NAME);
if (pythonLocation == null)
{
this.notReady("Unable to retrieve the Python Install Location from the registry!");
return;
}
// Construct the PATH.
this.path = pythonLocation + Path.PathSeparator;
this.path += pythonLocation + EnvironmentProperties.PATH_PYTHON_DLLS + Path.PathSeparator;
this.path += jdkDirectory + EnvironmentProperties.PATH_JAVA_BIN;
// Construct the PYTHON_PATH.
this.pythonPath = pythonLocation + EnvironmentProperties.PYTHON_PATH_PYTHON_LIBTK + Path.PathSeparator;
this.pythonPath += pythonLocation + EnvironmentProperties.PYTHON_PATH_PYTHON_DLLS + Path.PathSeparator;
this.pythonPath += pythonLocation + EnvironmentProperties.PYTHON_PATH_PYTHON_LIB + Path.PathSeparator;
this.pythonPath += pythonLocation;
this.ready = true;
}
private String resolveEnvironmentProperty(String property)
{
return Environment.ExpandEnvironmentVariables(property);
}
private String retrieveRegistryProperty(String registryKeyName, String valueName)
{
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(registryKeyName);
if (registryKey == null)
{
return null;
}
Object registryValue = registryKey.GetValue(valueName, null);
if (registryValue == null)
{
return null;
}
return registryValue.ToString();
}
private void notReady(String reason)
{
this.ready = false;
this.exceptionText = reason;
}
public String getLocation()
{
return this.location;
}
public String getLogDirectory()
{
return this.logDirectory;
}
public String getPath()
{
return this.path;
}
public String getPythonPath()
{
return this.pythonPath;
}
public bool isReady()
{
return this.ready;
}
public String getExceptionText()
{
return this.exceptionText;
}
}
}

View file

@ -0,0 +1,129 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
using VizLauncher.com.raytheon.viz.launcher.environment;
namespace VizLauncher.com.raytheon.viz.launcher.process
{
public abstract class AbstractProcessLauncher : IProcessLauncher
{
private static readonly String LOG_DATE_FORMAT = "yyyyMMdd_HHmmss";
protected static readonly String LOG_SUFFIX = ".log";
protected Process process = null;
private StreamWriter logFileWriter;
private bool ready = false;
private String exceptionText = null;
public AbstractProcessLauncher(VizEnvironment vizEnvironment)
{
// Prepare the log file.
if (Directory.Exists(vizEnvironment.getLogDirectory()) == false)
{
Directory.CreateDirectory(vizEnvironment.getLogDirectory());
}
String logName = vizEnvironment.getLogDirectory() +
Path.DirectorySeparatorChar + this.constructLogName(this.determineLogDate());
// Prepare the process.
this.process = new Process();
this.process.StartInfo = this.constructProcessStartInfo(vizEnvironment);
this.process.OutputDataReceived += new DataReceivedEventHandler(processOutputHandler);
this.validate();
if (this.ready == false)
{
return;
}
/*
* Access the log file for write access; other processes will have read-only access to
* the log file until it is closed.
**/
this.logFileWriter =
new StreamWriter(File.Open(logName, FileMode.Append,
FileAccess.Write, FileShare.Read));
}
private String determineLogDate()
{
return DateTime.Now.ToString(LOG_DATE_FORMAT);
}
private ProcessStartInfo constructProcessStartInfo(VizEnvironment vizEnvironment)
{
ProcessStartInfo processStartInfo =
new ProcessStartInfo(this.constructProcessName(vizEnvironment.getLocation()));
processStartInfo.EnvironmentVariables.Remove(EnvironmentProperties.ENVIRONMENT_VARIABLE_PATH);
processStartInfo.EnvironmentVariables.Add(
EnvironmentProperties.ENVIRONMENT_VARIABLE_PATH, vizEnvironment.getPath());
processStartInfo.EnvironmentVariables.Add(
EnvironmentProperties.ENVIRONMENT_VARIABLE_PYTHON_PATH, vizEnvironment.getPythonPath());
processStartInfo.UseShellExecute = false;
processStartInfo.Arguments = this.getCommandLineArguments();
processStartInfo.RedirectStandardOutput = true;
return processStartInfo;
}
protected void validate()
{
String application = this.process.StartInfo.FileName;
/* ensure that the specified application exists. */
if (File.Exists(application) == false)
{
this.ready = false;
this.exceptionText = "Unable to find the specified Viz application: " + application;
return;
}
this.ready = true;
}
public virtual void launchProcess()
{
this.runProcess();
this.closeLog();
}
protected void runProcess()
{
this.process.Start();
this.process.BeginOutputReadLine();
this.process.WaitForExit();
this.process.CancelOutputRead();
}
protected void closeLog()
{
this.logFileWriter.Close();
}
private void processOutputHandler(Object sendingProcess, DataReceivedEventArgs outline)
{
if (String.IsNullOrEmpty(outline.Data))
{
return;
}
this.logFileWriter.WriteLine(outline.Data);
}
public bool isReady()
{
return this.ready;
}
public String getExceptionText()
{
return this.exceptionText;
}
protected abstract String constructProcessName(String location);
protected abstract String constructLogName(String logDate);
protected abstract String getCommandLineArguments();
}
}

View file

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace VizLauncher.com.raytheon.viz.launcher.process
{
public interface IProcessLauncher
{
void launchProcess();
bool isReady();
String getExceptionText();
}
}

View file

@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;
using VizLauncher.com.raytheon.viz.launcher.process;
using VizLauncher.com.raytheon.viz.launcher.environment;
namespace VizLauncher.com.raytheon.viz.launcher.process.impl
{
public class AlertvizProcessLauncher : AbstractProcessLauncher
{
private static readonly String LOG_PREFIX = "alertviz_";
private static readonly String COMMAND_LINE_ARGUMENTS = "-component thinalertviz";
private static readonly String ALERTVIZ_PROCESS_NAME = "alertviz";
private static readonly String ALERTVIZ_EXECUTABLE =
Path.DirectorySeparatorChar + "AlertViz" +
Path.DirectorySeparatorChar + "alertviz.exe";
public AlertvizProcessLauncher(VizEnvironment vizEnvironment) : base(vizEnvironment)
{
}
public override void launchProcess()
{
// need to verify that another AlertViz process is not already running.
if (this.isAlertVizAlreadyRunning())
{
// do not start a new AlertViz process.
return;
}
this.runProcess();
while (this.process.ExitCode != 0)
{
this.runProcess();
}
this.closeLog();
}
private Boolean isAlertVizAlreadyRunning()
{
return (Process.GetProcessesByName(ALERTVIZ_PROCESS_NAME).Length > 0);
}
protected override String constructProcessName(String location)
{
return location + ALERTVIZ_EXECUTABLE;
}
protected override String constructLogName(String logDate)
{
return LOG_PREFIX + logDate + AbstractProcessLauncher.LOG_SUFFIX;
}
protected override String getCommandLineArguments()
{
return COMMAND_LINE_ARGUMENTS;
}
}
}

View file

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using VizLauncher.com.raytheon.viz.launcher.process;
using VizLauncher.com.raytheon.viz.launcher.environment;
namespace VizLauncher.com.raytheon.viz.launcher.process.impl
{
public class CaveProcessLauncher : AbstractProcessLauncher
{
private static readonly String LOG_PREFIX = "cave_";
private static readonly String COMMAND_LINE_ARGUMENTS = "-component thinclient";
private static readonly String CAVE_EXECUTABLE =
Path.DirectorySeparatorChar + "CAVE" + Path.DirectorySeparatorChar + "cave.exe";
public CaveProcessLauncher(VizEnvironment vizEnvironment)
: base(vizEnvironment)
{
}
protected override String constructProcessName(String location)
{
return location + CAVE_EXECUTABLE;
}
protected override String constructLogName(String logDate)
{
return LOG_PREFIX + logDate + AbstractProcessLauncher.LOG_SUFFIX;
}
protected override String getCommandLineArguments()
{
return COMMAND_LINE_ARGUMENTS;
}
}
}

Binary file not shown.