Esempio n. 1
0
        private Boolean TryParse(SocketData data, out ALDSData ALDS_Data)
        {
            MachineStatusData machineStatus;

            if (MachineStatusData.TryParse(data, out machineStatus))
            {
                ALDS_Data = machineStatus;
                return(true);
            }
            else
            {
                try
                {
                    //creates an ALDS data using
                    ALDS_Data = new ALDSData(data.DataName);
                    CustomHashTable table = (CustomHashTable)data.Value;
                    foreach (System.Collections.DictionaryEntry dice in table)
                    {
                        ALDS_Data.AttachDataAttribute((string)dice.Key, (string)dice.Value);
                    }
                }
                catch (Exception ex)
                {
                    ALDS_Data = null;
                    return(false);
                }

                return(true);
            }
        }
 private void _aldsDataClient_DataReceived(ALDSDataClient sender, ALDSData dataReceived)
 {
     try
     {
         UIControlsSafeAccessFunctions.ListBox_Items_Add(this.lstEventsReceived, dataReceived);
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 3
0
        private void StartMyTimer()
        {
            int waitIntervalTimer = 500;

            if (!MyTimer.Enabled)
            {
                MyTimer.Elapsed += new ElapsedEventHandler(SendDataInput);
                MyTimer.Interval = waitIntervalTimer;
                MyTimer.Enabled  = true;
            }
            else if (InputString.Length == TOOLING_TOOL_LENGTH)
            {
                this.textBox_DisplayKeyboardInput.Text = InputString;
                ALDSData containerData = new ALDSData(Defs.ALDSDATA_MESSAGEID);
                containerData.AttachDataAttribute(Defs.TOOLING_ID, InputString);
                Server.DistributeData(containerData);
                InputString = String.Empty;
                this.SuccessImage.Visible = true;
            }
        }
        private void _client_DataReceived(ALDSDataClient sender, ALDSData dataReceived)
        {
            if (dataReceived is MachineStatusData)
            {
                MachineStatusData statusData = (MachineStatusData)dataReceived;

                if (statusData.Status != MachineStatus.failure)
                {
                    this._manager.HandleMachineStatus(statusData.MachineName, statusData.Status);
                }
                else
                {
                    if (MachineStopped != null)
                    {
                        MachineStopped(statusData.MachineName);
                    }


                    this.notifyMachineStatus(this._linenumber, statusData.MachineName);
                }
            }
        }
Esempio n. 5
0
        public void DistributeData(ALDSData data)
        {
            SocketData dat = data.GetDistributableData();

            this._DataSocketServer.BroadCastData(dat);
        }