Пример #1
0
 internal void Start(int idleTimeMilliSeconds, EndPoint tcpAddress, EndPoint udpAddress
                     )
 {
     tcpServer = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.NewCachedThreadPool
                                                                           (), Executors.NewCachedThreadPool()));
     tcpServer.SetPipelineFactory(new _ChannelPipelineFactory_100(this, idleTimeMilliSeconds
                                                                  ));
     udpServer = new ConnectionlessBootstrap(new NioDatagramChannelFactory(Executors.NewCachedThreadPool
                                                                               ()));
     udpServer.SetPipeline(Channels.Pipeline(RpcUtil.StageRpcMessageParser, handler, RpcUtil
                                             .StageRpcUdpResponse));
     tcpChannel = tcpServer.Bind(tcpAddress);
     udpChannel = udpServer.Bind(udpAddress);
     allChannels.AddItem(tcpChannel);
     allChannels.AddItem(udpChannel);
     Log.Info("Portmap server started at tcp://" + tcpChannel.GetLocalAddress() + ", udp://"
              + udpChannel.GetLocalAddress());
 }
Пример #2
0
        public virtual void InitServer(string fsimage)
        {
            FSImageLoader loader = FSImageLoader.Load(fsimage);

            bootstrap.ChildHandler(new _ChannelInitializer_92(this, loader));
            channel = bootstrap.Bind(address).Sync().Channel();
            allChannels.AddItem(channel);
            address = (IPEndPoint)channel.LocalAddress();
            Log.Info("WebImageViewer started. Listening on " + address.ToString() + ". Press Ctrl+C to stop the viewer."
                     );
        }
Пример #3
0
		} // end void AddBatch();

		public ChannelGroup AddTreeRow(int row)
		{
			int pixID = batchStart;
			int groupMember = 1;
			int uch = 1;
			if (chIncr < 0) uch = batchCount * 3 - 2;
			int trkNum = Int16.Parse(txtTrack.Text) - 1;
			string theName = "";
			string pxName = "";
			string chName = "";
			string grName = "";
			int sxNo = 1;
			string sxName = "1S";
			int subNo = 1;

			grName = sectionName + "s Row " + (row+1).ToString("00");
			grName += " [U" + universeNum.ToString() + ".";
			if (optFenceReverse.Checked)
			{
				grName += (chanNum + 2).ToString("000") + "-" + (chanNum - pixelsPerRow * 3).ToString("000") + "]";
			}
			else
			{
				grName += chanNum.ToString("000") + "-" + (chanNum + pixelsPerRow * 3 + 2).ToString("000") + "]";
			}
			ChannelGroup thisGroup = seq.CreateChannelGroup(grName);

			for (int col = 7; col >= 0; col--)
			{
				for (int pix = 2; pix >= 0; pix--)
				{
					if (pixelNum < 301)
					{
						string pixName = "Tree Pixel " + pixelNum.ToString("000");
						pixName += " {R" + (row + 1).ToString("00");
						pixName += "C" + (col + 1).ToString("0");
						pixName += "P" + (pix + 1).ToString("0");
						pixName += FaceID(col);

						RGBchannel theRGBch = MakeRGBch(pixName, row, col, pix);
						thisGroup.AddItem(theRGBch);

						pixelNum ++;
						subNo++;
					} // End less than 301 pixels
				} // End pixels per column loop
			} // end columns per row loop

			return thisGroup;

		} // end void AddBatch();
Пример #4
0
		} // end void AddBatch();

		public ChannelGroup AddAirColumn(int c)
		{
			int pixID = batchStart;
			int groupMember = 1;
			int uch = 1;
			if (chIncr < 0) uch = batchCount * 3 - 2;
			int trkNum = Int16.Parse(txtTrack.Text) - 1;
			string theName = "";
			string pxName = "";
			string chName = "";
			string grName = "";

			grName = sectionName + " Column " + (c).ToString("0");
			grName += " [U" + universeNum.ToString() + ".";
			if (optFenceReverse.Checked)
			{
				grName += (chanNum - pixelsPerSect * 3 + 3).ToString("000") + "-" + (chanNum + 2).ToString("000") + "]";
			}
			else
			{
				grName += chanNum.ToString("000") + "-" + (chanNum + airRows * 3 + 2).ToString("000") + "]";
			}
			ChannelGroup thisGroup = seq.CreateChannelGroup(grName);

			for (int r = 0; r < airRows; r++)
			{
				pxName = sectionName + " " + (c).ToString("0");
				pxName += "," + (r).ToString("0");
				pxName += " #" + pixelNum.ToString("00");

				RGBchannel theRGBch = ShiprgbCh(pxName, c, r);
				thisGroup.AddItem(theRGBch);

			}

			return thisGroup;

		} // end void AddBatch();
Пример #5
0
		private void CreateGroups()
		{
			ChannelGroup grp = null;
			string nm = "";
			Array.Resize(ref rowGroups, 14);
			Array.Resize(ref colGroups, 8);
			seq = new Sequence4(lastFile);
			treeTrack = seq.CreateTrack("Tree Pixels [U7.001-U8-388");
			masterRowGroup = seq.CreateChannelGroup("Tree Pixels by Row");
			masterColGroup = seq.CreateChannelGroup("Tree Pixels by Column");
			treeTrack.AddItem(masterRowGroup);
			treeTrack.AddItem(masterColGroup);
			for (int r = 0; r < 14; r++)
			{
				nm = "Tree Pixels Row " + (r + 1).ToString();
				grp = seq.CreateChannelGroup(nm);
				rowGroups[r] = grp;
				masterRowGroup.AddItem(grp);
			}
			for (int c = 0; c < 8; c++)
			{
				nm = "Tree Pixels Column " + (c + 1).ToString();
				nm += " {" + DirName(c + 1) + "}";
				string f = FaceName(c + 1);
				if (f.Length > 0)
				{
					nm += "{" + f + "}";
				}
				grp = seq.CreateChannelGroup(nm);
				colGroups[c] = grp;
				masterColGroup.AddItem(grp);
			}




		}
Пример #6
0
		} // end btnMake_Click()

		public void AddStrip()
		{
			int pixID = stripStart;
			int nextSI = seq.Members.HighestSavedIndex;
			int groupMember = 1;
			int uch = 1;
			if (chIncr < 0) uch = stripCount * 3 - 2;
			int trkNum = Int16.Parse(txtTrack.Text) - 1;
			string chName;
			Channel redChannel = new Channel("(R)");  // Just placeholders
			Channel grnChannel = new Channel("(G)");
			Channel bluChannel = new Channel("(B)");
			//RGBchannel RGB_Channel = new RGBchannel("RGB");
			//ChannelGroup pixelGroup = new ChannelGroup();
			int chx;
			//groupCount = 0;
			int stripKeywdel = stripStart;
			int RGBFirstDMXchannel = 1;
			int RGBLastDMXchannel = -1;
			//int pixNumFirst = pixelNum;
			//int pixNumLast = pixNumFirst + groupSize - 1;
			//int stripNumFirst = stripStart;
			//int stripNumLast = 1;
			//int dmxChFirst = 1;
			//int dmxChLast = -1;


			/////////////////////////////////
			// MAKE A GROUP FOR THE STRIP //
			///////////////////////////////
			int dmxCount = stripCount * 3;
			if (reversed)
			{
				//Reverse
				int bb = stripEnd * 3 - 2;
				//chName = stripName + " Keywdels " + stripStart.ToString("000") + "-" + stripEnd.ToString("000") + " (U" + universeNum.ToString() + "." + bb.ToString("000") + "-" + dmxCount.ToString("000") + ")";
				int sst = pixelNum;
				int est = pixelNum + Math.Max(stripStart, stripEnd);
				chName = stripName + " Keywdels " + sst.ToString("000") + "-" + est.ToString("000");
				chName += " / S" + stripNum.ToString() + "." + stripStart.ToString("000") + "-" + stripEnd.ToString("000");
				chName += " / U" + universeNum.ToString() + "." + bb.ToString("000") + "-" + dmxCount.ToString("000") + ")";
			}
			else
			{
				// Forward
				//chName = stripName + " Keywdels " + stripStart.ToString("000") + "-" + stripCount.ToString("000") + " (U" + universeNum.ToString() + "." + stripStart.ToString("000") + "-" + dmxCount.ToString("000") + ")";
				chName = stripName + " Keywdels " + pixNumFirst.ToString("000") + "-" + pixNumLast.ToString("000");
				chName += " / S" + stripNum.ToString() + "." + stripStart.ToString("000") + "-" + stripEnd.ToString("000");
				chName += " / U" + universeNum.ToString() + "." + stripStart.ToString("000") + "-" + dmxCount.ToString("000") + ")";
			}
			ChannelGroup stripGroup = seq.CreateChannelGroup(chName);

			///////////////////////////////////////////////////////////
			// MAKE AN INITIAL CHANNEL GROUP FOR THE PIXEL GROUPING //
			/////////////////////////////////////////////////////////
			if (eaveNaming)
			{
				string gn = " Group ";
				if (groupNumber < 18)
				{
					//gn += (18 - groupNumber).ToString("00") + "L";
					gn += (groupNumber).ToString("00") + "L";
				}
				else
				{
					//gn += (groupNumber - 17).ToString("00") + "R";
					gn += (35 - groupNumber).ToString("00") + "R";
				}
				if (groupCount > 0)
				{
					gn += "b";
				}
				chName = stripName + gn;

			}
			else
			{
				//chName = stripName + " Keywdels " + stripNumFirst.ToString("000") + "-" + stripKeywdel.ToString("000");
				chName = stripName;
				//chName = " Keywdels " + (pixelNum - groupSize).ToString("000") + "-" + pixelNum.ToString("000") + " / S" + stripNum.ToString() + "." + stripNumFirst.ToString("000") + "-" + stripKeywdel.ToString("000") + " / U" + universeNum.ToString() + "." + dmxChFirst.ToString("000") + "-" + dmxChLast.ToString("000");
			}
			/*
			if (reversed)
			{
				stripNumFirst = stripStart;
				stripNumLast = stripStart - groupSize + 1;
				dmxChFirst = dmxCount - groupSize * 3 + 1;
				dmxChLast = dmxCount;
			}
			else
			{
				stripNumFirst = stripStart;
				stripNumLast = stripStart + groupSize - 1;
				dmxChFirst = 1;
				dmxChLast = groupSize * 3 - 1;
			}
			*/
			chName += " Keywdels " + pixNumFirst.ToString("000") + "-" + pixNumLast.ToString("000");
			chName += " / S" + stripNum.ToString() + "." + stripNumFirst.ToString("000") + "-" + stripNumLast.ToString("000");
			chName += " / U" + universeNum.ToString() + "." + dmxChFirst.ToString("000") + "-" + dmxChLast.ToString("000") + ")";
			ChannelGroup pixelGroup = seq.CreateChannelGroup(chName);
			stripGroup.AddItem(pixelGroup);


//			int gc = 
			pixNumFirst = (groupCount + 1) * groupSize + 1;
			pixNumLast = (groupCount + 2) * groupSize;
			stripNumFirst += (groupSize * chIncr);
			stripNumLast += (groupSize * chIncr) + 1;
			dmxChFirst += (groupSize * 3 * chIncr);
			dmxChLast += (groupSize * 3 * chIncr);
			
			if (stripNum == 2 )
			{
				pixNumFirst = 181;
				pixNumLast = 200;
				stripNumFirst = 11;
				stripNumLast = 30;
				dmxChFirst = 31;
				dmxChLast = 90;
			}
			if (stripNum == 3)
			{
				pixNumFirst = 361;
				pixNumLast = 380;
				stripNumFirst = 150;
				stripNumLast = 131;
				dmxChFirst = 391;
				dmxChLast = 450;
			}
			if (stripNum == 4)
			{
				pixNumFirst = 521;
				pixNumLast = 540;
				stripNumFirst = 11;
				stripNumLast = 30;
				dmxChFirst = 31;
				dmxChLast = 90;
			}



			string prfx = "";
			if (eaveNaming)
			{
				prfx = "Eave ";
			}

			//////////////////////
			// MAKE THE STRIP! //
			////////////////////
			while ((stripKeywdel > 0) && (stripKeywdel <= stripCount))
			{
				if (chOrder == 1) // RGB Order
				{
					//chName = stripName + " Keywdel " + stripKeywdel.ToString("000") + "(R) (U" + universeNum.ToString() + "." + uch.ToString("000") + ")";
					chName = prfx + "Keywdel " + pixelNum.ToString("000");
					chName += " (R) / S" + stripNum.ToString() + "." + stripKeywdel.ToString("000");
					chName += " / U" + universeNum.ToString() + "." + uch.ToString("000");
					redChannel = seq.CreateChannel(chName);
					redChannel.output.circuit = uch;
					RGBFirstDMXchannel = uch;
					uch++;

					//chName = stripName + " Keywdel " + stripKeywdel.ToString("000") + "(G) (U" + universeNum.ToString() + "." + uch.ToString("000") + ")";
					chName = prfx + "Keywdel " + pixelNum.ToString("000");
					chName += " (G) / S" + stripNum.ToString() + "." + stripKeywdel.ToString("000");
					chName += " / U" + universeNum.ToString() + "." + uch.ToString("000");
					grnChannel = seq.CreateChannel(chName);
					grnChannel.output.circuit = uch;
					uch++;

					chName = prfx + "Keywdel " + pixelNum.ToString("000");
					chName += " (B) / S" + stripNum.ToString() + "." + stripKeywdel.ToString("000");
					chName += " / U" + universeNum.ToString() + "." + uch.ToString("000");
					bluChannel = seq.CreateChannel(chName);
					bluChannel.output.circuit = uch;
					RGBLastDMXchannel = uch;
					uch++;
				}

				if (chOrder == 2) // GRB Order
				{
					//chName = stripName + " Keywdel " + stripKeywdel.ToString("000") + "(G) (U" + universeNum.ToString() + "." + uch.ToString("000") + ")";
					chName = prfx + "Keywdel " + pixelNum.ToString("000");
					chName += " (G) / S" + stripNum.ToString() + "." + stripKeywdel.ToString("000");
					chName += " / U" + universeNum.ToString() + "." + uch.ToString("000");
					grnChannel = seq.CreateChannel(chName);
					grnChannel.output.circuit = uch;
					RGBFirstDMXchannel = uch;
					uch++;

					//chName = stripName + " Keywdel " + stripKeywdel.ToString("000") + "(R) (U" + universeNum.ToString() + "." + uch.ToString("000") + ")";
					chName = prfx + "Keywdel " + pixelNum.ToString("000");
					chName += " (R) / S" + stripNum.ToString() + "." + stripKeywdel.ToString("000");
					chName += " / U" + universeNum.ToString() + "." + uch.ToString("000");
					redChannel = seq.CreateChannel(chName);
					redChannel.output.circuit = uch;
					uch++;

					//chName = stripName + " Keywdel " + stripKeywdel.ToString("000") + "(B) (U" + universeNum.ToString() + "." + uch.ToString("000") + ")";
					chName = prfx + "Keywdel " + pixelNum.ToString("000");
					chName += " (B) / S" + stripNum.ToString() + "." + stripKeywdel.ToString("000");
					chName += " / U" + universeNum.ToString() + "." + uch.ToString("000");
					bluChannel = seq.CreateChannel(chName);
					bluChannel.output.circuit = uch;
					RGBLastDMXchannel = uch;
					uch++;
				}
				redChannel.output.deviceType = DeviceType.DMX;
				redChannel.output.network = universeNum;
				redChannel.color = utils.LORCOLOR_RED;
				grnChannel.output.deviceType = DeviceType.DMX;
				grnChannel.output.network = universeNum;
				grnChannel.color = utils.LORCOLOR_GRN;
				bluChannel.output.deviceType = DeviceType.DMX;
				bluChannel.output.network = universeNum;
				bluChannel.color = utils.LORCOLOR_BLU;


				//dmxChLast = uch - 1;
				chx = uch - 2;
				//chName = stripName + " Keywdel " + stripKeywdel.ToString("000") + " (U" + universeNum.ToString() + "." + RGBFirstDMXchannel.ToString("000") + "-" + RGBLastDMXchannel.ToString("000") + ")";
				chName = prfx + "Keywdel " + pixelNum.ToString("000");
				chName += " / S" + stripNum.ToString() + "." + stripKeywdel.ToString("000");
				chName += " / U" + universeNum.ToString() + "." + RGBFirstDMXchannel.ToString("000") + "-" + RGBLastDMXchannel.ToString("000");
				RGBchannel RGB_Channel = seq.CreateRGBchannel(chName);
				RGB_Channel.redChannel = redChannel;
				RGB_Channel.grnChannel = grnChannel;
				RGB_Channel.bluChannel = bluChannel;
				pixelNum++;

				pixelGroup.AddItem(RGB_Channel);
				groupCount++;

				//////////////////////////////////
				// IS THE GROUP FULL?          //
				// iF SO, CREATE THE NEXT ONE //
				///////////////////////////////
				if (stripKeywdel < stripCount)
				{
					if (groupCount >= groupSize)
					{
						//stripNumLast = stripNumFirst + groupSize;
						//int uchStart = stripKeywdel * 3 - 2;
						if (chIncr < 0)
						{
							// Reverse
							//dmxChFirst = stripKeywdel * 3 - 2;
							//dmxChLast = stripNumFirst * 3;
						}
						else
						{
							// Forward
							// OK as-is
						}

						groupNumber++;
						//dmxChFirst = uch;
						//stripNumFirst = stripKeywdel + chIncr;
						if (eaveNaming)
						{
							string gn = " Group ";
							if (groupNumber < 18)
							{
								//gn += (18 - groupNumber).ToString("00") + "L";
								gn += (groupNumber).ToString("00") + "L";
							}
							else
							{
								//gn += (groupNumber - 17).ToString("00") + "R";
								gn += (35 - groupNumber).ToString("00") + "R";
							}
							chName = stripName + gn;
						}
						else
						{
							chName = stripName;
						}
						chName += " Keywdels " + pixNumFirst.ToString("000") + "-" + pixNumLast.ToString("000");
						chName += " / S" + stripNum.ToString() + "." + stripNumFirst.ToString("000") + "-" + stripNumLast.ToString("000");
						chName += " / U" + universeNum.ToString() + "." + dmxChFirst.ToString("000") + "-" + dmxChLast.ToString("000") + ")";
						pixelGroup = seq.CreateChannelGroup(chName);
						stripGroup.AddItem(pixelGroup);

						pixNumFirst = pixNumLast + 1;
						pixNumLast += groupSize;
						dmxChFirst += (groupSize * 3 * chIncr);
						dmxChLast += (groupSize * 3 * chIncr);
						stripNumFirst += (groupSize * chIncr);
						stripNumLast += (groupSize * chIncr);

						//pixelGroup = new ChannelGroup();
						groupCount = 0; // Reset

					}
				}
				else
				{
				}

				stripKeywdel += chIncr;
				if (chIncr < 0) uch -= 6;


				/////////////////////////////////
			} // end while pixel # in range //
				///////////////////////////////

			// Is there any leftover pixels?
			// (Happens when strip size is not evenly divisible by group size)
			if (groupCount > 0)
			{
				if (eaveNaming)
				{
					string gn = " Group ";
					if (groupNumber < 18)
					{
						//gn += (18 - groupNumber).ToString("00") + "aL";
						gn += (groupNumber).ToString("00") + "aL";
					}
					else
					{
						//gn += (groupNumber - 17).ToString("00") + "aR";
						gn += (35 - groupNumber).ToString("00") + "aR";
					}
					chName = stripName + gn;

				}
				else
				{
					chName = stripName;
				}
				pixNumFirst -= groupSize;
				pixNumLast = Math.Max(stripStart, stripEnd);
				stripNumFirst -= (groupSize * chIncr);
				stripNumLast = 1; //TODO Fix!
				dmxChFirst -= (groupSize * 3 * chIncr);
				dmxChLast = 1;
				chName += " Keywdels " + pixNumFirst.ToString("000") + "-" + pixNumLast.ToString("000");
				chName += " / S" + stripNum.ToString() + "." + stripNumFirst.ToString("000") + "-" + (stripKeywdel + 1).ToString("000");
				chName += " / U" + universeNum.ToString() + ".001" + "-" + dmxChLast.ToString("000") + ")";

				pixelGroup.ChangeName(chName);
				stripGroup.AddItem(pixelGroup);
				//dmxChFirst = uch;
				//stripNumFirst = stripKeywdel + chIncr;

			}
			if (groupCount >= groupSize)
			{
				groupNumber++;
				groupCount = 0;
			}

			// Add the Strip to the Track
			seq.Tracks[trkNum].AddItem(stripGroup);

		} // end void AddStrip();
Пример #7
0
		private void BuildTreeOld()
		{
			/////////////////////////////////////////////////////////////
			//
			//   Batch 2 IS THE BIG CENTER PIXEL TREE
			//   DONE AS MATRIX   ~~  Initially with 12 rows with 28 pixels each
			//   For a total of 340 pixels (2 full universes)
			//   Each row has 8 sections with initially 3 or 4 pixels on each row.
			//   Once the tree is built and tested, pixels will get moved to the row
			//   and section they actually end up in

			pixelNum = 1;
			rows = int.Parse(txtTreeRows.Text);
			pixelsPerRow = int.Parse(txtTreeCols.Text);
			int totalrgbChs = rows * pixelsPerRow;
			int totalChans = totalrgbChs * 3;
			universeNum = (int)numTreeUniverse.Value;
			int sectNum = 1;
			string baseName = txtTreeBaseName.Text;
			reversed = optTreeReverse.Checked;

			chanMatrix = new RGBchannel[rows, pixelsPerRow];
			sectionGroups = new ChannelGroup[rows];
			pixelGroups = new ChannelGroup[pixelsPerRow];

			sectionName = baseName + "s [U" + universeNum.ToString();
			sectionName += ".001-U" + (universeNum + 1).ToString() + ".";
			sectionName += (MAX_CH_PER_UNIV).ToString() + "]";
			int tknum = int.Parse(txtTrack.Text);
			Track trak = seq.CreateTrack(sectionName);

			sectionName = baseName + "s by Row [U" + universeNum.ToString();
			sectionName += ".001-U" + (universeNum + 1).ToString() + ".";
			sectionName += (MAX_CH_PER_UNIV).ToString() + "]";
			ChannelGroup grpRows = seq.CreateChannelGroup(sectionName);
			trak.AddItem(grpRows);

			sectionName = baseName + "s by Section [U" + universeNum.ToString();
			sectionName += ".001-U" + (universeNum + 1).ToString() + ".";
			sectionName += (MAX_CH_PER_UNIV).ToString() + "]";
			ChannelGroup grpCols = seq.CreateChannelGroup(sectionName);
			trak.AddItem(grpCols);

			int direction = 1; // forward, set to -1 for reverse


			sectionName = baseName;
			sectionNum = 1;
			pixelNum = 1;
			if (optTreeReverse.Checked)
			{
				universeNum++;
				int n1 = totalrgbChs - 160;
				int n2 = n1 * 3 - 2;
				chanNum = n2;
				batchStart = Int16.Parse(txtFenceStartCh.Text);
				batchEnd = Int16.Parse(txtFenceStartCh.Text);
				chIncr = -1;
			}
			else
			{
				chanNum = 1;
				batchStart = Int16.Parse(txtFenceStartCh.Text);
				batchEnd = Int16.Parse(txtFenceSections.Text);
				chIncr = 1;
			}

			if (optTreeRGB.Checked) chOrder = 1;
			if (optTreeGRB.Checked) chOrder = 2;

			for (int r = 0; r < rows; r++)
			{
				//TODO: Reverse Order
				// Use just forward order for now
				//ChannelGroup theGroup = AddRow(r);
				//grpRows.AddItem(theGroup);
			}

			for (int pxl = 0; pxl < pixelsPerRow; pxl++)
			{
				string grName = sectionName + "s Section " + pxl.ToString("00");
				ChannelGroup theGroup = seq.CreateChannelGroup(grName);
				for (int row = 0; row < rows; row++)
				{
					theGroup.AddItem(chanMatrix[row, pxl]);
				}
				grpCols.AddItem(theGroup);

			}


		} // end btnMake_Click()
Пример #8
0
		} // end btnMake_Click()

		private void BuildShip()
		{
			/////////////////////////////////////////////////////////////
			//
			//   Batch 3 IS THE AIRSHIP PROJECTOR
			//   DONE AS MATRIX   ~~  x Columns by Y Rows
			//   Grouped by Column and by Row
			
			pixelNum = 0;
			airCols = Int16.Parse(txtAirCols.Text);
			airRows = Int16.Parse(txtAirRows.Text);
			int totalrgbChs = airRows * airCols;
			int totalChans = totalrgbChs * 3;
			universeNum = (int)numUnivAirship.Value;
			int airCol = 1;
			string baseName = txtAirName.Text;
			reversed = false;

			//Array.Resize(ref chanMatrix[], sections, pixelsPerSect);
			chanMatrix = new RGBchannel[airCols, airRows];
			//colGroups = new ChannelGroup[airCols];
			//rowGroups = new ChannelGroup[airRows];

			sectionName = baseName + " [U" + universeNum.ToString();
			sectionName += ".001-U" + (universeNum).ToString() + ".";
			sectionName += (64 * 3).ToString() + "]";
			int tknum = int.Parse(txtTrack.Text);
			Track trak = seq.CreateTrack(sectionName);

			sectionName = baseName + " by Column [U" + universeNum.ToString();
			sectionName += ".001-U" + (universeNum).ToString() + ".";
			sectionName += (64 * 3).ToString() + "]";
			ChannelGroup grpCols = seq.CreateChannelGroup(sectionName);
			trak.AddItem(grpCols);

			sectionName = baseName + " by Row [U" + universeNum.ToString();
			sectionName += ".001-U" + (universeNum).ToString() + ".";
			sectionName += (64 * 3).ToString() + "]";
			ChannelGroup grpRows = seq.CreateChannelGroup(sectionName);
			trak.AddItem(grpRows);




			sectionName = baseName;
			sectionNum = 1;
			pixelNum = 1;
			chanNum = 1;
			batchStart = Int16.Parse(txtFenceStartCh.Text);
			batchEnd = Int16.Parse(txtFenceSections.Text);
			chIncr = 1;

			if (optRGB3.Checked) chOrder = 1;
			if (optGRB3.Checked) chOrder = 2;

			// Sections
			for (int c = 0; c < airCols; c++)
			{
				//TODO: Reverse Order
				// Use just forward order for now
				ChannelGroup theGroup = AddAirColumn(c);
				grpCols.AddItem(theGroup);
			}


			// Create the second major group
			// Another copy of the matrix, but pivoted
			// Grouped by Row instead of by Column
			for (int r = 0; r < airRows; r++)
			{
				string grName = sectionName + " Row " + (r).ToString("0");
				ChannelGroup theGroup = seq.CreateChannelGroup(grName);
				for (int c = 0; c < airCols; c++)
				{
					theGroup.AddItem(chanMatrix[c, r]);
				}
				grpRows.AddItem(theGroup);

			}


		} // end btnMake_Click()
Пример #9
0
		private void BuildFence()
		{
			/////////////////////////////////////////////////////////////
			//
			//   Batch 1 IS THE PERIMETER FENCE
			//   DONE AS MATRIX   ~~  x Sections by Y rgbChs-per-section
			//   Grouped by Section, and
			//   Grouped by rgbCh # (per section)

			pixelNum = 1;
			sections = Int16.Parse(txtFenceSections.Text);
			pixelsPerSect = Int16.Parse(txtFenseSectionSize.Text);
			int totalrgbChs = sections * pixelsPerSect;
			int totalChans = totalrgbChs * 3;
			universeNum = (int)numFenceUniverse.Value;
			int sectNum = 1;
			string baseName = txtFenceBaseName.Text;
			reversed = optFenceReverse.Checked;

			//Array.Resize(ref chanMatrix[], sections, pixelsPerSect);
			chanMatrix = new RGBchannel[sections, pixelsPerSect];
			sectionGroups = new ChannelGroup[sections];
			pixelGroups = new ChannelGroup[pixelsPerSect];

			sectionName = baseName + "s [U" + universeNum.ToString();
			sectionName += ".001-U" + (universeNum + 1).ToString() + ".";
			sectionName += (166 * 3).ToString() + "]";
			int tknum = int.Parse(txtTrack.Text);
			Track trak = seq.CreateTrack(sectionName);

			sectionName = baseName + "s by Section [U" + universeNum.ToString();
			sectionName += ".001-U" + (universeNum + 1).ToString() + ".";
			sectionName += (166 * 3).ToString() + "]";
			ChannelGroup grpSects =  seq.CreateChannelGroup(sectionName);
			trak.AddItem(grpSects);

			sectionName = baseName + "s by rgbCh # [U" + universeNum.ToString();
			sectionName += ".001-U" + (universeNum + 1).ToString() + ".";
			sectionName += (166 * 3).ToString() + "]";
			ChannelGroup grpPixels = seq.CreateChannelGroup(sectionName);
			trak.AddItem(grpPixels);

			


			sectionName = baseName;
			sectionNum = 1;
			pixelNum = 1;
			if (optFenceReverse.Checked)
			{
				universeNum++;
				int n1 = totalrgbChs - MAX_PIX_PER_UNIV;
				int n2 = n1 * 3 - 2;
				chanNum = n2;
				batchStart = Int16.Parse(txtFenceStartCh.Text);
				batchEnd = Int16.Parse(txtFenceStartCh.Text);
				chIncr = -1;
			}
			else
			{
				chanNum = 1;
				batchStart = Int16.Parse(txtFenceStartCh.Text);
				batchEnd = Int16.Parse(txtFenceSections.Text);
				chIncr = 1;
			}
				
			if (optFenceRGB.Checked) chOrder = 1;
			if (optFenceGRB.Checked) chOrder = 2;

			// Sections
			for (int sect = 0; sect < sections; sect++)
			{
				//TODO: Reverse Order
				// Use just forward order for now
				ChannelGroup theGroup = AddSection(sect);
				grpSects.AddItem(theGroup);
			}


			// Create the second major group
			// Another copy of the matrix, but pivoted
			// Grouped by rgbCh # instead of by sectioon #
			for (int pxl = 0; pxl < pixelsPerSect; pxl++)
			{
				string grName = sectionName + "s #" + (pxl+1).ToString("00") + "s";
				ChannelGroup theGroup = seq.CreateChannelGroup(grName);
				for (int s=0; s< sections; s++)
				{
					theGroup.AddItem(chanMatrix[s, pxl]);
				}
				grpPixels.AddItem(theGroup);

			}

			
		} // end btnMake_Click()
Пример #10
0
 /// <exception cref="System.Exception"/>
 public override void ChannelActive(ChannelHandlerContext ctx)
 {
     activeChannels.AddItem(ctx.Channel());
 }
Пример #11
0
 /// <exception cref="System.Exception"/>
 public override void ChannelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
 {
     allChannels.AddItem(e.GetChannel());
 }