public void AddLumberDoubleRow(string data1, string data2) { //data1 is the first line, data2 is the second int LumberNumber = Convert.ToInt32(data1.Substring(3, 2)); int Grade = Convert.ToInt32(data1.Substring(7, 2)); double Depth = Convert.ToDouble(data1.Substring(11, 4)); double Thick = Convert.ToDouble(data1.Substring(16, 4)); string Description = data1.Substring(21); int E = scientificNumber(data2.Substring(42, 9)); int Fb = Convert.ToInt32(data2.Substring(53, 4)); int Fc = Convert.ToInt32(data2.Substring(58, 4)); int Ft = Convert.ToInt32(data2.Substring(63, 4)); int Fcp = Convert.ToInt32(data2.Substring(68, 4)); int Fv = Convert.ToInt32(data2.Substring(73, 4)); MSR MSR = enumMSRCheck(data2[77]); CW CW = enumCWCheck(data2.Substring(79, 3)); int pointer = 83; while (data2[pointer] != ' ') { pointer++; } string SizeName = data2.Substring(81, pointer - 83); Lumbers.Add(new Lumber(LumberNumber, Grade, Depth, Thick, Description, E, Fb, Fc, Ft, Fcp, Fb, MSR, CW, SizeName)); }
internal asyncReceiveState(MSR.LST.Net.Sockets.Socket sock, BufferChunk bufferChunk, Queue queue, ReceivedFromCallback receivedFromCallback) { this.sock = sock; this.bufferChunk = bufferChunk; this.queue = queue; this.receivedFromCallback = receivedFromCallback; }
private void handleFrameReceived(object sender, MSR.LST.Net.Rtp.RtpStream.FrameReceivedEventArgs ea) { BufferChunk chunk = ea.Frame; string source = ea.RtpStream.Properties.CName; try { using (MemoryStream ms = new MemoryStream(chunk.Buffer)) { object msg = this.m_bf.Deserialize(ms); if (msg is UW.ClassroomPresenter.Network.Messages.Message) { NetworkEvent newEvent = new NetworkMessageEvent((Message)msg, DateTime.Now.Ticks, source); this.m_archiver.AppendEvent(newEvent); EventArchivedDelegate ead = new EventArchivedDelegate(this.EventArchived); ead(this, newEvent); } else if (msg is UW.ClassroomPresenter.Network.Chunking.Chunk) { NetworkEvent newEvent = new NetworkChunkEvent((UW.ClassroomPresenter.Network.Chunking.Chunk)msg, DateTime.Now.Ticks, source); this.m_archiver.AppendEvent(newEvent); EventArchivedDelegate ead = new EventArchivedDelegate(this.EventArchived); ead(this, newEvent); } else if (msg is UW.ClassroomPresenter.Network.RTP.RtpNackMessage) { NetworkEvent newEvent = new NetworkNACKMessageEvent((UW.ClassroomPresenter.Network.RTP.RtpNackMessage)msg, DateTime.Now.Ticks, source); this.m_archiver.AppendEvent(newEvent); EventArchivedDelegate ead = new EventArchivedDelegate(this.EventArchived); ead(this, newEvent); } } } catch (Exception e) { Debug.WriteLine("EXCEPTION : " + e.ToString() + " : " + e.StackTrace); } }
private void OnForm_KeyPress(object sender, KeyPressEventArgs e) { switch (e.KeyChar) { case (char)Keys.Enter: string keyboardScan = keyboardScanBuffer.ToString(); keyboardScanBuffer.Clear(); // IF scan is a MSR if ((keyboardScan.StartsWith(MSR.StartTrack, StringComparison.OrdinalIgnoreCase) || keyboardScan.StartsWith(MSR.StartTrack2, StringComparison.OrdinalIgnoreCase)) && (keyboardScan.EndsWith(MSR.EndTrack, StringComparison.OrdinalIgnoreCase))) { string[] tracks = MSR.SplitTrackData(keyboardScan); if (!string.IsNullOrWhiteSpace(tracks[1])) { ICardInfo cardInfo = PosApplication.Instance.BusinessLogic.Utility.CreateCardInfo(); // We just need card number from track 2 cardInfo.Track2 = tracks[1]; if (cardInfo.CardNumber.Length > 0) { IExtendedLogOnInfo extendedLogOnInfo = new DE.ExtendedLogOnInfo() { LogOnKey = cardInfo.CardNumber, LogOnType = ExtendedLogOnType.MagneticStripeReader, Message = ApplicationLocalizer.Language.Translate(99409) /*Card swipe accepted*/ }; HandleExtendedLogOnInfo(extendedLogOnInfo); } } } else // If not, treat it as barcode scan. { IExtendedLogOnInfo extendedLogOnInfo = new DE.ExtendedLogOnInfo() { LogOnKey = keyboardScan, LogOnType = ExtendedLogOnType.Barcode, Message = ApplicationLocalizer.Language.Translate(99408) /*Bar code accepted*/ }; HandleExtendedLogOnInfo(extendedLogOnInfo); } break; default: keyboardScanBuffer.Append(e.KeyChar); break; } e.Handled = true; }
public Type this [ MSR.LST.ConferenceXP.PayloadType payloadType ] { get { return (Type) Dictionary[payloadType]; } set { if ( value.GetType() != Type.GetType("Type") ) { throw new ArgumentException(Strings.ValueMustBeAType, Strings.Value); } Dictionary[payloadType] = value; } }
public void InsertIntialMSR(Domain.ApproverInfo approverInfo, String project, String vwl, String comments, String budgetYear, String bpNo, String afe, String sugVendor, String contactVendor, DateTime reqDate) { using (var context = new MSR_MaxEntities()) { //Log DB commands to console context.Database.Log = Console.WriteLine; //First obtain referenced users var usr_RO = context.Usrs.Find(BusinessAPI.BusinessSingleton.Instance.userInfo_EF.UserId); var usr_CA = context.Usrs.Find(Int32.Parse(approverInfo.UserId)); //Initialize new MSR var tempMSR = new MSR { Project = project, WVL = vwl, Comments = comments, BudgetYear = Int32.Parse(budgetYear), BP_No = bpNo, AFE = afe, SugVendor = sugVendor, ContactVendor = contactVendor, Usr_RO = usr_RO, Usr_CA = usr_CA, Req_Date = reqDate, PUR_Comment = "", Decline_Comment = "", Review_Comment = "", StateFlag = Domain.WorkFlowTrace.WAIT_FOR_APPROVAL }; //Adds the newly created MSR context.MSRs.Add(tempMSR); context.SaveChanges(); //Gets the just inserted MSR int MSRId = tempMSR.MSRId; //Attaches the FormItems to that MSR just created InsertInitialFormItems(BusinessAPI.BusinessSingleton.Instance.formItemListCreateMSR, MSRId); } }
public MSR GetMSRByMSRId(String msrId) { MSR msr = null; using (var context = new MSR_MaxEntities()) { //Log DB commands to console context.Database.Log = Console.WriteLine; var msr_db = context.MSRs .Include("FormItems") .Include("Usr_RO") .Include("Usr_CA") .Include("Usr_RecieveBy") .Where(x => x.MSRId.ToString().Equals(msrId)) .First(); msr = msr_db; } return(msr); }
public bool AddLumber(string data) { //this if is to check that E is starting when it's supposed to if (data[40] != '1' && data[40] != '2' && data[40] != '3' && data[40] != '4' && data[40] != '5' && data[40] != '6' && data[40] != '7' && data[40] != '8' && data[40] != '9' && data[40] != '0') { return(false); } int LumberNumber = Convert.ToInt32(data.Substring(3, 2)); int Grade = Convert.ToInt32(data.Substring(7, 2)); double Depth = Convert.ToDouble(data.Substring(11, 4)); double Thick = Convert.ToDouble(data.Substring(16, 4)); int pointer = 39; char fun = data[40]; while (data[pointer] == ' ') { pointer--; } string Description = data.Substring(21, pointer - 21); int E = scientificNumber(data.Substring(40, 9)); int Fb = Convert.ToInt32(data.Substring(51, 4)); int Fc = Convert.ToInt32(data.Substring(56, 4)); int Ft = Convert.ToInt32(data.Substring(61, 4)); int Fcp = Convert.ToInt32(data.Substring(66, 4)); int Fv = Convert.ToInt32(data.Substring(71, 4)); MSR MSR = enumMSRCheck(data[75]); CW CW = enumCWCheck(data.Substring(77, 3)); pointer = 81; while (data[pointer] != ' ') { pointer++; } string SizeName = data.Substring(81, pointer - 81); Lumbers.Add(new Lumber(LumberNumber, Grade, Depth, Thick, Description, E, Fb, Fc, Ft, Fcp, Fb, MSR, CW, SizeName)); return(true); }
private static ICapabilityViewer CreateCapabilityForRtpStream(MSR.LST.Net.Rtp.RtpStream rtpStream) { //Pri2: Should use a match from rtpStream.PayloadType via VenueServer to a GUID which is used to lookup the assembly used to view. //Pri2: VenueServer should also have a link from CapabilityViewerGuid to CapabilityViewerAssembly that can be auto-installed on demand MSR.LST.ConferenceXP.PayloadType payloadType = (MSR.LST.ConferenceXP.PayloadType)rtpStream.PayloadType; if (!capabilityViewerClasses.ContainsKey(payloadType)) { throw new Exception("CapabilityViewer for PayloadType " + payloadType.ToString() + " not found!"); } return (ICapabilityViewer)Activator.CreateInstance( capabilityViewerClasses[payloadType], new object[]{Capability.DynaPropsFromRtpStream(rtpStream)}); }
private void HandleStreamRemoved(object sender, MSR.LST.Net.Rtp.RtpEvents.RtpStreamEventArgs args) { using(Synchronizer.Lock(this.m_Sender.m_Classroom.SyncRoot)) { using(Synchronizer.Lock(this)) { // Do not check (or care) whether the RTPMessageSender has been disposed, // because we will get lots of RtpStreamRemoved events when the RtpSession is closed. RtpStream stream = args.RtpStream; RTPMessageReceiver receiver = ((RTPMessageReceiver) this.m_Receivers[stream]); if(receiver != null) { receiver.Dispose(); this.m_Receivers.Remove(stream); } // Discard all pending Nacks so the NackManager doesn't keep nacking them forever. this.m_Sender.NackManager.Discard( stream.SSRC, Range.UNIVERSE ); // If this was the last stream for the participant, unregister the ParticipantModel // and remove it from the classroom. string cname = stream.Properties.CName; RtpParticipant client = this.m_Sender.m_RtpSession.Participants[cname]; if(client == null || client.SSRCs.Count <= 0) { ParticipantModel participant = ((ParticipantModel) this.m_Participants[cname]); if(participant != null) { // Remove the participant from the classroom. if(this.m_Sender.m_Classroom.Participants.Contains(participant)) this.m_Sender.m_Classroom.Participants.Remove(participant); } // Remove the participant from the table. this.m_Participants.Remove(cname); } } } }
public Lumber(int LumberNumber, int Grade, double Depth, double Thick, string Description, int E, int Fb, int Fc, int Ft, int Fcp, int Fv, MSR MSR, CW CW, string SizeName) { this.LumberNumber = LumberNumber; this.Grade = Grade; this.DepthInches = Depth; this.ThickInches = Thick; this.Description = Description; this.EPSI = E; this.FbPSI = Fb; this.FcPSI = Fc; this.FtPSI = Ft; this.FcpPSI = Fcp; this.FvPSI = Fv; this.MSR = MSR; this.CW = CW; this.SizeName = SizeName; }
public override void StreamAdded(MSR.LST.Net.Rtp.RtpStream rtpStream) { base.StreamAdded(rtpStream); if (OnStreamAdded != null) { OnStreamAdded(rtpStream); } }
public void Remove ( MSR.LST.ConferenceXP.PayloadType payloadType ) { Dictionary.Remove ( payloadType ); }
public ShowMSR_WaitForApproval(String msrId) { InitializeComponent(); msrInfo = BusinessAPI.BusinessSingleton.Instance.MSRInfoAPI.GetMSRByMSRId(msrId); }
private void handleRtpStreamRemoved(object sender, MSR.LST.Net.Rtp.RtpEvents.RtpStreamEventArgs ea) { if (this.streams.Contains(ea.RtpStream)) { this.streams.Remove(ea.RtpStream); } ea.RtpStream.FrameReceived -= new MSR.LST.Net.Rtp.RtpStream.FrameReceivedEventHandler(this.handleFrameReceived); }
public override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); msr = new MSR(); msr.addDataListener(this); }
public ShowMSR_NeedReview(String msrId) { InitializeComponent(); msrInfo = BusinessAPI.BusinessSingleton.Instance.MSRInfoAPI.GetMSRByMSRId(msrId); }
void OnStreamRemoved(MSR.LST.Net.Rtp.RtpStream rtpStream) { //Debug.WriteLine("OnStreamRemoved ssrc=" + rtpStream.SSRC.ToString() + ";cname=" + rtpStream.Properties.CName); // Do not check (or care) whether the RTPMessageSender has been disposed, // because we will get lots of RtpStreamRemoved events when the RtpSession is closed. // Unregister the ParticipantModel and remove it from the classroom. string cname = rtpStream.Properties.CName; if (this.m_Participants.ContainsKey(cname)) { using (Synchronizer.Lock(this.m_Classroom.SyncRoot)) { if (this.m_Classroom.Participants.Contains(m_Participants[cname])) { this.m_Classroom.Participants.Remove(m_Participants[cname]); } } this.m_Participants.Remove(cname); } //If the stream being removed is our currently associated instructor: if (cname.Equals(m_AssociationCname)) { using (Synchronizer.Lock(this.m_Model.Network.SyncRoot)) { this.m_Model.Network.Association = null; } m_AssociationCname = null; } if (this.m_Receivers.ContainsKey(cname)) { uint remoteSsrc = this.m_Receivers[cname].RemoteSsrc; if (this.m_SsrcToSenderId.ContainsKey(remoteSsrc)) { this.m_SsrcToSenderId.Remove(remoteSsrc); } else { Trace.WriteLine("!!!!Warning: Failed to find SSRC in lookup table when removing stream."); } // Discard all pending Nacks so the NackManager doesn't keep nacking them forever. this.NackManager.Discard(remoteSsrc, Range.UNIVERSE); //Clean up the receiver //Debug.WriteLine("Removed receiver cname: " + cname + "; receiver SSRC: " + remoteSsrc.ToString()); this.m_Receivers[cname].Dispose(); this.m_Receivers.Remove(cname); } else { //Debug.WriteLine("Removed a stream for which we have no capability receiver cname: " + cname); } }
void OnStreamAdded(MSR.LST.Net.Rtp.RtpStream rtpStream) { //Debug.WriteLine("OnStreamAdded ssrc=" + rtpStream.SSRC.ToString() + ";cname=" + rtpStream.Properties.CName); using (Synchronizer.Lock(this.m_Classroom.SyncRoot)) { if (rtpStream.SSRC != this.m_Capability.RtpSender.SSRC) { //We need the participant Guid before we can set up the participant model. Do that on receipt of the first message from a given remote node. //Debug.WriteLine("Adding stream ssrc: " + rtpStream.SSRC.ToString()); } else { //Debug.WriteLine("Ignoring RTP Stream Add because the stream SSRC matches the RTPSender SSRC"); } } }
public bool ContainsKey ( MSR.LST.ConferenceXP.PayloadType payloadType ) { return Dictionary.Contains ( payloadType ); }
private void handleRtpStreamAdded(object sender, MSR.LST.Net.Rtp.RtpEvents.RtpStreamEventArgs ea) { this.streams.Add(ea.RtpStream); ea.RtpStream.FrameReceived += new MSR.LST.Net.Rtp.RtpStream.FrameReceivedEventHandler(this.handleFrameReceived); }
public void Add ( MSR.LST.ConferenceXP.PayloadType payloadType, Type type ) { Dictionary.Add( payloadType, type ); }
public Type this[MSR.LST.ConferenceXP.PayloadType payloadType] { get { return (Type) Dictionary[payloadType]; } set { if ( value.GetType() != Type.GetType("Type") ) { throw new ArgumentException( "value must be a Type", "value" ); } Dictionary[payloadType] = value; } }