예제 #1
0
 static void comm_GotStartPublishMessage(object sender, WatchdogMessageEventArgs <StartPublishMessage> e)
 {
     if (e.msg.machineName == null || e.msg.machineName.Equals(WatchdogComm.GetMachineName()) == false)
     {
         return;                                                                                                          //not for us
     }
     Trace.WriteLine("Got Publish Start Command for: " + e.msg.publishName + " from " + e.msg.senderName);
     StartPublish(e.msg.publishName);
 }
예제 #2
0
        static void comm_GotWatchdogStatusMessage(object sender, WatchdogMessageEventArgs <WatchdogStatusMessage> e)
        {
            if (e.msg.curPublishName.ToLower() == LocalMapPublishName)
            {
                isLocalMapRunning = (e.msg.statusLevel == WatchdogStatusMessage.StatusLevel.Running);
            }

            if (e.msg.curPublishName.ToLower() == SceneEstimatorPublishName)
            {
                isSceneEstimatorRunning = (e.msg.statusLevel == WatchdogStatusMessage.StatusLevel.Running);
            }
        }
예제 #3
0
 void comm_GotWatchdogStatusMessage(object sender, WatchdogMessageEventArgs <WatchdogStatusMessage> e)
 {
     try
     {
         if (this.IsDisposed == false)
         {
             this.BeginInvoke(new MethodInvoker(delegate() { UpdateWatchdogStatus(e.msg); }));
         }
     }
     catch
     { }
 }
예제 #4
0
        void comm_GotStartPublishMessageReply(object sender, WatchdogMessageEventArgs <StartStopPublishMessageReply> e)
        {
            Trace.WriteLine(e.msg.senderName + ": Got Message On Start : OK?" + e.msg.ok + " " + e.msg.status + " for publish " + e.msg.publishName);

            if (e.msg.ok)
            {
                notifyIcon1.ShowBalloonTip(1000, "Publish " + e.msg.publishName + "  Started OK", "Status: " + e.msg.status, ToolTipIcon.Info);
            }
            else
            {
                notifyIcon1.ShowBalloonTip(1000, "Publish " + e.msg.publishName + " FAILED ", "Status: " + e.msg.status, ToolTipIcon.Error);
            }
        }
예제 #5
0
 static void comm_GotStopPublishMessage(object sender, WatchdogMessageEventArgs <StopPublishMessage> e)
 {
     if (curPublish == null)
     {
         return;
     }
     if (e.msg.publishName.ToLower() != curPublish.name.ToLower())
     {
         return;
     }
     try
     {
         curPublish.Stop();
     }
     catch (Exception ex)
     {
         Trace.WriteLine("Exception Stopping! " + ex.Message);
         comm.SendMessage <StartStopPublishMessageReply>(new StartStopPublishMessageReply(WatchdogComm.GetMachineName(), e.msg.publishName, false, "Exception Stopping Publish" + ex.Message));
     }
     curPublish.WatchdogReset -= new EventHandler(curPublish_WatchdogReset);
 }
 static void comm_GotWatchdogTerminateMessage(object sender, WatchdogMessageEventArgs<WatchdogTerminateMessage> e)
 {
     KillApp();
 }
 static void comm_GotStopPublishMessage(object sender, WatchdogMessageEventArgs<StopPublishMessage> e)
 {
     if (curPublish == null) return;
     if (e.msg.publishName.ToLower() != curPublish.name.ToLower()) return;
     try
     {
         curPublish.Stop();
     }
     catch (Exception ex)
     {
         Trace.WriteLine("Exception Stopping! " + ex.Message);
         comm.SendMessage<StartStopPublishMessageReply>(new StartStopPublishMessageReply(WatchdogComm.GetMachineName(), e.msg.publishName, false, "Exception Stopping Publish" + ex.Message));
     }
     curPublish.WatchdogReset -= new EventHandler(curPublish_WatchdogReset);
 }
 static void comm_GotStartPublishMessage(object sender, WatchdogMessageEventArgs<StartPublishMessage> e)
 {
     if (e.msg.machineName==null || e.msg.machineName.Equals(WatchdogComm.GetMachineName()) == false) return; //not for us
     Trace.WriteLine("Got Publish Start Command for: " + e.msg.publishName + " from " + e.msg.senderName);
     StartPublish(e.msg.publishName);
 }
        static void comm_GotCommandMessage(object sender, WatchdogMessageEventArgs<CommandMessage> e)
        {
            if (!((e.msg.machineName.ToLower() == WatchdogComm.GetMachineName().ToLower()) || (e.msg.machineName == CommandMessage.ALLMACHINES)))
                return;

            Trace.WriteLine("Executing Command: " + e.msg.command.ToString());
            switch (e.msg.command)
            {
                case CommandMessage.WatchdogCommand.AddServiceRight :
                    LocalSecurityPolicyManager.SetRight("labuser", LocalSecurityPolicyManager.ServiceRight);
                    break;
                case CommandMessage.WatchdogCommand.EnableWatchdogAutoReset:
                    if (curPublish != null) { curPublish.watchdogAutoRestart = true; curPublish.Save(pubRoot); }
                    break;
                case CommandMessage.WatchdogCommand.DisableWatchdogAutoReset:
                    if (curPublish != null) { curPublish.watchdogAutoRestart = false; curPublish.Save(pubRoot); }
                    break;
                case CommandMessage.WatchdogCommand.Quit:
                    KillApp();
                    break;
                case CommandMessage.WatchdogCommand.StartRemoteDebugger:
                    try
                    {
                        Process[] p = Process.GetProcessesByName("msvsmon");
                        Trace.WriteLine("MSVSMONS : " + p.Length);
                        if (p.Length > 0)
                        {
                            foreach (Process mon in p)
                            {
                                mon.Kill();
                            }
                        }
                        Trace.WriteLine("Starting : " + pubRoot + "\\deployment\\debugger.bat");
                        ProcessStartInfo pi = new ProcessStartInfo(pubRoot + "\\deployment\\debugger.bat");
                        pi.WorkingDirectory = pubRoot + "\\deployment";
                        Process.Start(pi);
                    }
                    catch
                    { }

                    break;
                case CommandMessage.WatchdogCommand.RefreshPublishes:
                        SendStatusMessage();
                    break;
                case CommandMessage.WatchdogCommand.AutoDetectRunningPublish:
                    if (curPublish == null)
                    {
                        Publish autoP = AutodetectActivePublish();
                        if (autoP != null)
                        {
                            StartPublish(autoP.name);
                        }
                    }
                    break;
            }
        }
예제 #10
0
 static void comm_GotWatchdogTerminateMessage(object sender, WatchdogMessageEventArgs <WatchdogTerminateMessage> e)
 {
     KillApp();
 }
예제 #11
0
        static void comm_GotCommandMessage(object sender, WatchdogMessageEventArgs <CommandMessage> e)
        {
            if (!((e.msg.machineName.ToLower() == WatchdogComm.GetMachineName().ToLower()) || (e.msg.machineName == CommandMessage.ALLMACHINES)))
            {
                return;
            }

            Trace.WriteLine("Executing Command: " + e.msg.command.ToString());
            switch (e.msg.command)
            {
            case CommandMessage.WatchdogCommand.AddServiceRight:
                LocalSecurityPolicyManager.SetRight("labuser", LocalSecurityPolicyManager.ServiceRight);
                break;

            case CommandMessage.WatchdogCommand.EnableWatchdogAutoReset:
                if (curPublish != null)
                {
                    curPublish.watchdogAutoRestart = true; curPublish.Save(pubRoot);
                }
                break;

            case CommandMessage.WatchdogCommand.DisableWatchdogAutoReset:
                if (curPublish != null)
                {
                    curPublish.watchdogAutoRestart = false; curPublish.Save(pubRoot);
                }
                break;

            case CommandMessage.WatchdogCommand.Quit:
                KillApp();
                break;

            case CommandMessage.WatchdogCommand.StartRemoteDebugger:
                try
                {
                    Process[] p = Process.GetProcessesByName("msvsmon");
                    Trace.WriteLine("MSVSMONS : " + p.Length);
                    if (p.Length > 0)
                    {
                        foreach (Process mon in p)
                        {
                            mon.Kill();
                        }
                    }
                    Trace.WriteLine("Starting : " + pubRoot + "\\deployment\\debugger.bat");
                    ProcessStartInfo pi = new ProcessStartInfo(pubRoot + "\\deployment\\debugger.bat");
                    pi.WorkingDirectory = pubRoot + "\\deployment";
                    Process.Start(pi);
                }
                catch
                { }

                break;

            case CommandMessage.WatchdogCommand.RefreshPublishes:
                SendStatusMessage();
                break;

            case CommandMessage.WatchdogCommand.AutoDetectRunningPublish:
                if (curPublish == null)
                {
                    Publish autoP = AutodetectActivePublish();
                    if (autoP != null)
                    {
                        StartPublish(autoP.name);
                    }
                }
                break;
            }
        }
        static void comm_GotWatchdogStatusMessage(object sender, WatchdogMessageEventArgs<WatchdogStatusMessage> e)
        {
            if (e.msg.curPublishName.ToLower() == LocalMapPublishName)
            {
                isLocalMapRunning = (e.msg.statusLevel == WatchdogStatusMessage.StatusLevel.Running);
            }

            if (e.msg.curPublishName.ToLower() == SceneEstimatorPublishName)
            {
                isSceneEstimatorRunning = (e.msg.statusLevel == WatchdogStatusMessage.StatusLevel.Running);
            }
        }