private void ResumeOperationsCommandReceived()
        {
            cmdCtrlEmergencyStop.Down    = false;
            cmdCtrlEmergencyStop.Enabled = true;
            cmdCtrlResumeOps.Enabled     = false;

            StudioContext.LogWarning("RESUME OPERATIONS: normal operation stablished");
        }
        private void EmergencyStopCommandReceived()
        {
            cmdCtrlEmergencyStop.Down    = true;
            cmdCtrlEmergencyStop.Enabled = false;
            cmdCtrlResumeOps.Enabled     = true;

            StudioContext.LogWarning("EMERGENCY stop all locomotoves activated");
        }
        private void AccessoryOperationCommandReceived(IAccessoryOperation command)
        {
            Element element = Element.GetByAccessoryAddress(command.Address);

            if (element != null)
            {
                element.SetAccessoryStatus(command.Status);

                StudioContext.LogInformation("Accessory {0:D4} changed to status #{1}", command.Address, command.Status);
            }
            else
            {
                StudioContext.LogWarning("Accessory {0:D4} changed to status #{1}: Address not used in current layout", command.Address, command.Status);
            }
        }
        private void DigitalSystem_OnInformationReceived(object sender, Otc.Systems.SystemConsoleEventArgs e)
        {
            switch (e.Type)
            {
            case SystemConsoleEventArgs.MessageType.Error:
                StudioContext.LogError(e.Message);
                break;

            case SystemConsoleEventArgs.MessageType.Warning:
                StudioContext.LogWarning(e.Message);
                break;

            case SystemConsoleEventArgs.MessageType.Debug:
                StudioContext.LogDebug(e.Message);
                break;

            default:
                StudioContext.LogInformation(e.Message);
                break;
            }
        }