Esempio n. 1
0
        private void AppendToLog(ActivityMessage action)
        {
            if (!IsActive || AllLoggingPaused)
            {
                return;
            }

            if (action.DeviceType == DeviceTypeEnum.Telescope && EnableTelescopeLogging ||
                action.DeviceType == DeviceTypeEnum.Dome && EnableDomeLogging ||
                action.DeviceType == DeviceTypeEnum.Focuser && EnableFocuserLogging)
            {
                if (action.MessageType == ActivityMessageTypes.Capabilities && EnableCapabilitiesLogging ||
                    action.MessageType == ActivityMessageTypes.Commands && EnableCommandLogging ||
                    action.MessageType == ActivityMessageTypes.Other && EnableOthersLogging ||
                    action.MessageType == ActivityMessageTypes.Parameters && EnableParametersLogging ||
                    action.MessageType == ActivityMessageTypes.Status && EnableStatusLogging)
                {
                    string newText = FormatEntry(action.MessageText);

                    // UpdateTheLog( newText );

                    lock ( _bufferLock )
                    {
                        DataBuffer.Append(newText);
                    }
                }
            }
        }
Esempio n. 2
0
 public void SendDataTo(Int32 id, Byte[] data)
 {
     try {
         var b = new DataBuffer();
         b.WriteInt32(data.Length);
         b.Append(data);
         Clients[id].BeginSend(b.ToArray(), 0, (Int32)b.Length(), SocketFlags.None, new AsyncCallback(DataSent), Clients[id]);
     } catch { }
 }
Esempio n. 3
0
        public void SendData(Byte[] data)
        {
            var b = new DataBuffer();

            b.WriteInt32(data.Length);
            b.Append(data);
            try {
                this.MainSocket.BeginSend(b.ToArray(), 0, (Int32)b.Length(), SocketFlags.None, new AsyncCallback(DataSent), null);
            } catch { }
        }