Example #1
0
        public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
        {
            _setupNode = setupNode;

            InitNodes();
            InitPorts();
        }
Example #2
0
 public EventSequence(Preference2 preferences)
     : this()
 {
     _fullChannels = new List<Channel>();
     Channels = new List<Channel>();
     PlugInData = new SetupData();
     Extensions = new SequenceExtensions();
     if (preferences != null) {
         _eventPeriod = preferences.GetInteger("EventPeriod");
         MinimumLevel = (byte) preferences.GetInteger("MinimumLevel");
         MaximumLevel = (byte) preferences.GetInteger("MaximumLevel");
         var profileName = preferences.GetString("DefaultProfile");
         if (profileName.Length > 0) {
             AttachToProfile(profileName);
         }
         AudioDeviceIndex = preferences.GetInteger("DefaultSequenceAudioDevice");
     }
     else {
         _eventPeriod = 100;
         MinimumLevel = 0;
         MaximumLevel = 255;
         AudioDeviceIndex = -1;
     }
     Time = 60000;
 }
Example #3
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.m_portAddress = this.m_setupData.GetInteger(this.m_setupNode, "port", 0);
     this.m_port = new PortMapping(this.m_portAddress);
 }
Example #4
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.SetPort();
     byte[] buffer = new byte[3];
     buffer[0] = 0xff;
     this.m_packet = buffer;
     this.m_shadow = new byte[executableObject.Channels.Count];
 }
Example #5
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode, ITickSource timer)
 {
     this.m_executable = executableObject;
     this.m_timer = timer;
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.m_portAddress = (ushort) this.m_setupData.GetInteger(this.m_setupNode, "address", 0x378);
     this.m_useWithScript = this.m_setupData.GetBoolean(this.m_setupNode, "useWithScript", false);
     executableObject.UserData = this.m_frames;
 }
Example #6
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     this.m_dataNode = setupNode;
     if (this.m_hardware == null)
     {
         this.m_hardware = new EZ_8();
     }
     string innerText = Xml.GetNodeAlways(this.m_dataNode, "Port").InnerText;
     this.m_hardware.PortName = (innerText.Length != 0) ? innerText : null;
 }
Example #7
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     _channels.Clear();
     _channels.AddRange(executableObject.FullChannels);
     _setupData = setupData;
     _setupNode = setupNode;
     if (_setupNode.Attributes != null) {
         _startChannel = Convert.ToInt32(_setupNode.Attributes["from"].Value) - 1;
     }
     setupData.GetBytes(_setupNode, "BackgroundImage", new byte[0]);
 }
Example #8
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.m_channelCount = executableObject.Channels.Count;
     this.m_deviceStarts[0] = setupData.GetInteger(setupNode, "Device0", 0);
     this.m_deviceStarts[1] = setupData.GetInteger(setupNode, "Device1", 8);
     this.m_deviceStarts[2] = setupData.GetInteger(setupNode, "Device2", 0x10);
     this.m_deviceStarts[3] = setupData.GetInteger(setupNode, "Device3", 24);
     this.m_offset = int.Parse(this.m_setupNode.Attributes["from"].Value) - 1;
 }
Example #9
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.m_filePath = Xml.GetNodeAlways(this.m_setupNode, "LastFilePath").InnerText;
     if (this.m_filePath == string.Empty)
     {
         this.m_filePath = Path.GetTempFileName();
         Xml.GetNodeAlways(this.m_setupNode, "LastFilePath").InnerText = this.m_filePath;
     }
 }
Example #10
0
 public Profile()
 {
     FileName = string.Empty;
     _isFrozen = false;
     TreatAsLocal = false;
     Key = Host.GetUniqueKey();
     _channelObjects = new List<Channel>();
     _channelOutputs = new List<int>();
     PlugInData = new SetupData();
     IsDirty = false;
 }
Example #11
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     if ((executableObject.Channels.Count % 8) != 0)
     {
         this.m_packet = new byte[((executableObject.Channels.Count / 8) + 1) * 8];
     }
     else
     {
         this.m_packet = new byte[executableObject.Channels.Count];
     }
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.SetPort();
 }
Example #12
0
 public RouterContext(byte[] engineBuffer, SetupData pluginData, IExecutable executableObject)
 {
     EngineBuffer = engineBuffer;
     PluginData = pluginData;
     ExecutableObject = executableObject;
     OutputPluginList = new List<MappedOutputPlugIn>();
     foreach (var item in from XmlNode node in PluginData.GetAllPluginData(SetupData.PluginType.Output, true)
         where node.Attributes != null
         select
             new MappedOutputPlugIn(OutputPlugins.FindPlugin(node.Attributes["name"].Value, true),
                 Convert.ToInt32(node.Attributes["from"].Value), Convert.ToInt32(node.Attributes["to"].Value), node)) {
         OutputPluginList.Add(item);
     }
 }
Example #13
0
 public RouterContext CreateContext(byte[] engineBuffer, SetupData pluginData, IExecutable executableObject)
 {
     var item = new RouterContext(engineBuffer, pluginData, executableObject);
     var newSize = Math.Max((_data == null) ? 0 : _data.Length, item.EngineBuffer.Length);
     if (_data == null) {
         _data = new byte[newSize];
     }
     else if (_data.Length < newSize) {
         Array.Resize(ref _data, newSize);
     }
     foreach (var outputPlugIn in item.OutputPluginList) {
         lock (_outputPlugins) {
             _outputPlugins.Add(outputPlugIn);
         }
     }
     _instances.Add(item);
     return item;
 }
Example #14
0
 public EventSequence()
 {
     _fullChannels = new List<Channel>();
     Channels = new List<Channel>();
     PlugInData = new SetupData();
     Extensions = new SequenceExtensions();
     EventValues = null;
     _eventPeriod = 100;
     MinimumLevel = 0;
     MaximumLevel = 255;
     Audio = null;
     TotalEventPeriods = 0;
     WindowWidth = 0;
     WindowHeight = 0;
     ChannelWidth = 0;
     EngineType = EngineType.Standard;
     _profile = null;
     TreatAsLocal = false;
     AudioDeviceIndex = -1;
     AudioDeviceVolume = 0;
     Key = Host.GetUniqueKey();
 }
Example #15
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode, ITickSource timer)
 {
     this.m_setupNode = setupNode;
     this.m_setupData = setupData;
     this.m_timer = timer;
     XmlNode node = ((EventSequence) executableObject).Extensions[".led"]["Boards"];
     this.m_useWithScript = node == null;
     if (node != null)
     {
         this.m_boardLayout = new Size(int.Parse(node.Attributes["width"].Value), int.Parse(node.Attributes["height"].Value));
     }
     else
     {
         string[] strArray = this.m_setupData.GetString(this.m_setupNode, "BoardLayout", "1,1").Split(new char[] { ',' });
         this.m_boardLayout = new Size(int.Parse(strArray[0].Trim()), int.Parse(strArray[1].Trim()));
     }
     this.m_ledSize = this.m_setupData.GetInteger(this.m_setupNode, "LEDSize", 3);
     this.m_ledColor = Color.FromArgb(this.m_setupData.GetInteger(this.m_setupNode, "LEDColor", -65536));
     this.m_dotPitch = this.m_setupData.GetInteger(this.m_setupNode, "DotPitch", 9);
     executableObject.UserData = this.m_frames;
     this.m_executable = executableObject;
 }
Example #16
0
        public APSetupDialog(SetupData setupData, XmlNode setupNode, IList<Channel> channels, int startChannel)
        {
            _backgroundImageFileName = string.Empty;
            _dirty = false;
            _channelDictionary = new Dictionary<int, List<uint>>();
            _controlDown = false;
            _originalBackground = null;
            _resizing = false;
            InitializeComponent();
            _setupData = setupData;
            _setupNode = setupNode;
            _startChannel = startChannel;
            _channels = new List<Channel>();

            toolStripComboBoxPixelSize.SelectedIndex = 7;
            toolStripComboBoxChannels.BeginUpdate();
            for (var channel = _startChannel; channel < channels.Count; channel++) {
                toolStripComboBoxChannels.Items.Add(string.Format("{0}: {1}", channel + 1, channels[channel].Name));
                _channels.Add(channels[channel]);
            }
            toolStripComboBoxChannels.EndUpdate();
            UpdateFromSetupNode();
        }
Example #17
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
 }
Example #18
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.EnsurePort("Parallel1");
     this.EnsurePort("Parallel2");
     this.EnsurePort("Parallel3");
     this.CompilePortMappings();
 }
Example #19
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     _setupData = setupData;
     _setupNode = setupNode;
     SetPort();
     _packet = new byte[(_header.Length + executableObject.Channels.Count) + _footer.Length];
     _header.CopyTo(_packet, 0);
     _footer.CopyTo(_packet, _packet.Length - _footer.Length);
 }
Example #20
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     _setupData = setupData;
     _setupNode = setupNode;
     InitSerialPort();
     _holdPort = _setupData.GetBoolean(_setupNode, HoldNode, true);
 }
Example #21
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.m_startChannel = int.Parse(this.m_setupNode.Attributes["from"].Value) - 1;
     XmlNode nodeAlways = Xml.GetNodeAlways(setupNode, "Serial");
     this.m_selectedPort = new SerialPort(this.m_setupData.GetString(nodeAlways, "Name", "COM1"), this.m_setupData.GetInteger(nodeAlways, "Baud", 0x1c200), (Parity) Enum.Parse(typeof(Parity), this.m_setupData.GetString(nodeAlways, "Parity", Parity.None.ToString())), this.m_setupData.GetInteger(nodeAlways, "Data", 8), (StopBits) Enum.Parse(typeof(StopBits), this.m_setupData.GetString(nodeAlways, "Stop", StopBits.One.ToString())));
     this.m_selectedPort.Handshake = Handshake.None;
     this.m_selectedPort.Encoding = Encoding.UTF8;
     XmlNode node2 = setupNode.SelectSingleNode("Modules");
     if (node2 != null)
     {
         for (int i = 0; i < 4; i++)
         {
             XmlNode node3 = node2.SelectSingleNode(string.Format("Module[@id=\"{0}\"]", i + 1));
             if (node3 != null)
             {
                 this.m_modules[i].Enabled = bool.Parse(node3.Attributes["enabled"].Value);
                 if (this.m_modules[i].Enabled)
                 {
                     this.m_modules[i].StartChannel = Convert.ToInt32(node3.Attributes["start"].Value);
                 }
             }
         }
     }
     this.m_holdPort = this.m_setupData.GetBoolean(this.m_setupNode, "HoldPort", false);
     this.m_acOperation = this.m_setupData.GetBoolean(this.m_setupNode, "ACOperation", false);
 }
Example #22
0
        public void Shutdown()
        {
            if (_previewDialog != null) {
                if (_previewDialog.InvokeRequired) {
                    _previewDialog.BeginInvoke(new MethodInvoker(_previewDialog.Dispose));
                }
                else {
                    _previewDialog.Dispose();
                }
                _previewDialog = null;
            }

            _channels.Clear();
            _setupData = null;
            _setupNode = null;
        }
Example #23
0
        //-------------------------------------------------------------
        //
        //    Initialize() - called anytime vixen needs to make sure the
        //                   plugin's setup or initialization is up to
        //                   date. Initialize is called before the plugin
        //                   is setup, before sequence execution, and
        //                   other times. It's called from multiple
        //                   places at any time, therefore the plugin
        //                   can make no assumptions about the state
        //                   of the program or sequence due to a call
        //                   to initialize.
        //
        //-------------------------------------------------------------
        public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
        {
            // save a local copy of the setup objects

            _setupNode = setupNode;

            // load all of our xml into working objects

            LoadSetupNodeInfo();

            // find all of the network interfaces & build a sorted list indexed by Id

            _nicTable = new SortedList<string, NetworkInterface>();

            var nics = NetworkInterface.GetAllNetworkInterfaces();

            if (nics.Length > 0)
                foreach (var nic in nics.Where(nic => nic.NetworkInterfaceType.CompareTo(NetworkInterfaceType.Tunnel) != 0)) {
                    _nicTable.Add(nic.Id, nic);
                }
        }
Example #24
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode, ITickSource timer)
 {
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.m_tick = timer;
     this.UpdateFromSetup();
 }
Example #25
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.SetPort();
     for (int i = 0; i < this.m_channelGroupControllers.Length; i++)
     {
         int num;
         int num3 = i + 1;
         if (int.TryParse(Xml.GetNodeAlways(this.m_setupNode, "Group" + num3.ToString()).InnerText, out num))
         {
             this.m_channelGroupControllers[i] = num;
         }
         else
         {
             this.m_channelGroupControllers[i] = -1;
         }
     }
 }
Example #26
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     _setupNode = setupNode;
     if (_setupNode.SelectSingleNode("Programs") == null) {
         Xml.GetNodeAlways(_setupNode, "Programs");
     }
 }
Example #27
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.m_portAddress = (ushort) this.m_setupData.GetInteger(this.m_setupNode, "address", 0);
 }
Example #28
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.SetPort();
 }
Example #29
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     MccBoard board;
     int num = 0;
     this.m_boards = new MccBoard[GlobalConfig.NumBoards];
     this.m_boardPortType = new DigitalPortType[GlobalConfig.NumBoards];
     int index = 0;
     while (index < GlobalConfig.NumBoards)
     {
         board = new MccBoard(index);
         board.BoardConfig.GetBoardType(out num);
         if (num == 0)
         {
             break;
         }
         this.m_boards[index] = board;
         this.m_boardPortType[index] = (DigitalPortType)1;
         index++;
     }
     Array.Resize<MccBoard>(ref this.m_boards, index);
     Array.Resize<DigitalPortType>(ref this.m_boardPortType, index);
     this.m_hardwareMap = new VixenPlus.HardwareMap[index];
     int num3 = 0;
     int num6 = 0;
     Dictionary<string, int> dictionary = new Dictionary<string, int>();
     this.m_pinBoardIndex = new int[0];
     this.m_pinBoardOffset = new int[0];
     for (index = 0; index < this.m_boards.Length; index++)
     {
         Dictionary<string, int> dictionary2;
         string str;
         board = this.m_boards[index];
         if (!dictionary.ContainsKey(board.BoardName))
         {
             dictionary[board.BoardName] = 0;
         }
         this.m_hardwareMap[index] = new VixenPlus.HardwareMap(board.BoardName, dictionary[board.BoardName]);
         (dictionary2 = dictionary)[str = board.BoardName] = dictionary2[str] + 1;
         int pinCount = this.m_pinCount;
         board.BoardConfig.GetDiNumDevs(out num3);
         for (int i = 0; i < num3; i++)
         {
             int num5;
             board.DioConfig.GetDevType(i, out num5);
             if (num5 == 10)
             {
                 this.m_boardPortType[index] = (DigitalPortType)10;
             }
             board.DConfigPort((DigitalPortType) num5, DigitalPortDirection.DigitalOut);
             board.DioConfig.GetNumBits(i, out num6);
             Array.Resize<int>(ref this.m_pinBoardIndex, this.m_pinBoardIndex.Length + num6);
             Array.Resize<int>(ref this.m_pinBoardOffset, this.m_pinBoardOffset.Length + num6);
             for (int j = 0; j < num6; j++)
             {
                 this.m_pinBoardIndex[j + this.m_pinCount] = index;
                 this.m_pinBoardOffset[j + this.m_pinCount] = (this.m_pinCount + j) - pinCount;
             }
             this.m_pinCount += num6;
         }
     }
 }
Example #30
0
 public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode)
 {
     this.m_setupData = setupData;
     this.m_setupNode = setupNode;
     this.m_version = this.m_setupData.GetInteger(this.m_setupNode, "Version", 2);
     this.m_selectedPort = new SerialPort(this.m_setupData.GetString(this.m_setupNode, "name", "COM1"), this.m_setupData.GetInteger(this.m_setupNode, "baud", 0x9600), (Parity) Enum.Parse(typeof(Parity), this.m_setupData.GetString(this.m_setupNode, "parity", Parity.None.ToString())), this.m_setupData.GetInteger(this.m_setupNode, "data", 8), (StopBits) Enum.Parse(typeof(StopBits), this.m_setupData.GetString(this.m_setupNode, "stop", StopBits.One.ToString())));
     this.m_selectedPort.Handshake = Handshake.None;
     this.m_selectedPort.Encoding = Encoding.UTF8;
 }
Example #31
0
 private void LoadFromProfile()
 {
     PlugInData = _profile.PlugInData;
     UpdateEventValueArray();
 }