public void SetBirthTime(DateTime timeValue, TS_Precision precision)
        {
            TS birthDT = new TS(timeValue);
            birthDT.DateValuePrecision = TS_Helper.ConvertPrecision(precision);

            relatedSubject.subjectPerson.SetBirthTime(birthDT);
        }
Example #2
0
 /// <summary>
 /// 获取当前用户的ServiceCell的当前时隙的可用功率
 /// </summary>
 /// <param name="tsnum">时隙号</param>
 /// <param name="user">当前用户</param>
 /// <returns></returns>
 public static float GetAvailablePower(TS tsNum, TDSimUser user)
 {
     float usedPower = user.ServiceCell.Slots[(int)tsNum].CurPower;//单位为db值
     float maxCellPower = user.ServiceCell.Slots[(int)tsNum].MaxPowerforR4;//小区R4最大的发射功率(具体的取值跟功率分配策略有关:静态功率分配,动态功率分配),单位为db值
     float result = (float)UnitTrans.dBto(maxCellPower) - (float)UnitTrans.dBto(usedPower);//单位为线性值
     return (float)UnitTrans.todB(Math.Abs(result));
 }
Example #3
0
	public static int Main ()
	{
		var r = new TS ().v;
		if (r != 5)
			return 1;

		return 0;
	}
Example #4
0
 public p_author_000081(TS authorTime)
     : base()
 {
     typeCode = "AUT";
     contextControlCode = "OP";
     functionCode = new CV<string>("OA", "2.16.840.1.113883.2.1.3.2.4.17.178", null, null, "Originating Author", null);
     functionCode.OriginalText = null;
     time = new IVL<TS>(authorTime);
 }
Example #5
0
        public void CalcInterfereVale_Test()
        {
            InterfereCalculator interfereCalculator = new InterfereCalculator();
            IGetLinkloss linkLoss = new MockIGetLinkloss();
            IInterfCalc interfCalc = new MockIInterfCalc();
            ISmartAntCalcGain smartAntCalcGain = new MockISmartAntCalcGain();

            interfereCalculator.Initialization(linkLoss, interfCalc, smartAntCalcGain);

            TDSimUser user;
            user = MockDPAUser.CreatTDSimUser_CS();

            TDSimUser user1;
            user1 = MockDPAUser.CreatTDSimUser_CS();
            TDSimUser user2;
            user2 = MockDPAUser.CreatTDSimUser_CS();
            TDSimUser userR4;
            userR4 = MockDPAUser.CreatTDSimUser_CS();

            TS timeSlot = new TS();
            TDSimCell tdCell;
            tdCell = MockCell.CreatTDSimCell();
            TDSimCell tdInterCell;
            tdInterCell = MockCell.CreatTDSimCell();
            tdInterCell.NeCell.FreqBand.DLFrequency = 1900f;

            user.ServiceCell.TDIntefCells.Add(tdCell);
            user.ServiceCell.TDIntefCells.Add(tdInterCell);

            tdCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user1);
            tdCell.Slots[(int)timeSlot].AccessedUsers.Add(userR4);

            tdInterCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user1);
            tdInterCell.Slots[(int)timeSlot].AccessedUsers.Add(userR4);

            user.ServiceCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user1);
            user.ServiceCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user2);

            user.ServiceCell.Slots[(int)timeSlot].AccessedUsers.Add(userR4);

            //ISimCellBase GSMCell = new MockISimCellBase();
            //GSMCell.Cell.FreqBand = new FrequencyBand();
            //GSMCell.Cell.FreqBand.BandWidth = 10000;
            //ISimCellBase UMTSCell = new MockISimCellBase();
            //UMTSCell.Cell.FreqBand = new FrequencyBand();
            //UMTSCell.Cell.FreqBand.BandWidth = 20000;
            //List<ISimCellBase> GSMInterf = new List<ISimCellBase>();
            //List<ISimCellBase> UMTSInterf = new List<ISimCellBase>();
            //GSMInterf.Add(GSMCell);
            //UMTSInterf.Add(UMTSCell);

            //user.ServiceCell.GSMIntefCells = GSMInterf;
            //user.ServiceCell.UMTSIntefCells = UMTSInterf;

            Assert.AreEqual((int)(interfereCalculator.CalcInterfereVale(user, timeSlot)), 3.0);
        }
 // Use this for initialization
 void Start()
 {
     nameOfCamType = gameObject.name;
     logged = true;
     bsInLog = gameObject.GetComponent<BS> ();
     tsScript = compassTimer.GetComponent<TS> ();
     if(Directory.Exists("./GAMELOGS/"+WS.returnPlayerName()+"/"+gameObject.name))
         Debug.Log("Directory already exists!");
     else
         Directory.CreateDirectory("./GAMELOGS/"+WS.returnPlayerName()+"/"+gameObject.name);
 }
Example #7
0
        /// <summary>
        /// 计算干扰
        /// 为了实现接口
        /// </summary>
        /// <param name="user"></param>
        /// <param name="txPower">对该用户的发射功率</param>
        /// <returns></returns>
        public float CalcInterfereVale(TDSimUser user, TS indexOfTimeslot)
        {
            float iOwn = CalculateCurInterference(user, indexOfTimeslot);
            if (float.IsNegativeInfinity(iOwn))
            {
                iOwn = TimeSlot.HSDPAZeroPower;
            }

            float iOther = CalculateNeighborInterference(user, indexOfTimeslot);
            if (float.IsNegativeInfinity(iOther))
            {
                iOther = TimeSlot.HSDPAZeroPower;
            }
            float N = user.ServiceCell.BackNoise_DB;
            float result = AddPower(iOwn, iOther, N);

            return result;


        }
Example #8
0
 /// <summary>
 /// 计算上行同频本小区干扰
 /// </summary>
 /// <param name="user"></param>
 /// <param name="tsnum"></param>
 /// <param name="link"></param>
 /// <returns>上行同频本小区干扰,单位为线性值</returns>
 public float CalcULIntraIntf(TDSimUser user, TS tsNum)
 {
     float totalIntef = 0.0f;
     TimeSlot slot = user.ServiceCell.Slots[(int)tsNum];
     foreach (TDSimUser intfUser in slot.AccessedUsers)
     {
         //为该用户自己,自己的功率不算做干扰功率
         if (intfUser == user)
         {
             continue;
         }
         else
         {
             float ulTotalLoss = m_TotalLoss.GetULTotalLoss(intfUser
                 , user.ServiceCell);
             float sASideGain = m_SmartAnt.GetSmartAntSideGain(user, intfUser, LinkType.Uplink);
             totalIntef += (float)UnitTrans.dBmTomw(intfUser.LinkSet[tsNum].TxPower - ulTotalLoss + sASideGain);
         }
     }
     return totalIntef;
 }
Example #9
0
 /// <summary>
 /// 计算上行同频邻小区干扰
 /// </summary>
 /// <param name="user"></param>
 /// <param name="tsnum"></param>
 /// <param name="link"></param>
 /// <returns>上行同频邻小区干扰,单位为线性值</returns>
 public float CalcULInterInf(TDSimUser user, TS tsNum)
 {
     float totalIntef = 0.0f;
     List<TDSimCell> intefCells = GetSameIntefCells(user);
     foreach (TDSimCell cell in intefCells)
     {
         if (cell != user.ServiceCell)
         {
             if (cell.Slots[(int)tsNum].LinkDirection != user.ServiceCell.Slots[(int)tsNum].LinkDirection)
             {
                 continue;
             }
             foreach (TDSimUser intfUser in cell.Slots[(int)tsNum].AccessedUsers)
             {
                 float ulTotalLoss = m_TotalLoss.GetULTotalLoss(intfUser, user.ServiceCell);
                 float gain = m_SmartAnt.GetSmartAntSideGain(user, intfUser, LinkType.Uplink);
                 totalIntef += (float)UnitTrans.dBmTomw(intfUser.LinkSet[tsNum].TxPower - ulTotalLoss + gain);
             }
         }
     }
     return totalIntef;
 }
Example #10
0
            public void TestObjectLiteral()
            {
                var c = new Config {
                    Temp = "Frank"
                };
                var tempFrank = new Config {
                }.GetTmp(c);

                Assert.AreEqual("1: Frank", tempFrank, "Check call works");

                var options = new Bridge.ClientTestHelperExternal.AjaxOptions {
                    Data = new { Name = c.Temp }
                };

                Assert.AreEqual("Frank", options.Data["Name"], "External referenced default ObjectLiteral works");

                var bs = new BS();

                Assert.True(Bridge1529.IsPlainObject(bs));
                Assert.AreEqual(10, bs.field1);
                Assert.AreEqual("test", bs.field2);
                Assert.AreEqual(10, bs.GetField1());
                Assert.AreEqual("test", bs.GetField2());
                Assert.AreEqual(0, bs.GetProp1());
                Assert.AreEqual(10, bs.ProxyField1);
                Assert.AreEqual("test", bs.ProxyField2);
                Assert.AreEqual(0, bs.Prop1);
                Assert.Null(bs.Prop2);
                Assert.AreEqual(11, BS.StaticProp);

                var bs1 = BS.Create(3, "test3");

                Assert.True(Bridge1529.IsPlainObject(bs1));
                Assert.AreEqual(3, bs1.field1);
                Assert.AreEqual("test3", bs1.field2);

                var bs2 = new BS(5);

                Assert.True(Bridge1529.IsPlainObject(bs2));
                Assert.AreEqual(5, bs2.field1);
                Assert.AreEqual("test", bs2.field2);

                var bs3 = new BS("test5");

                Assert.True(Bridge1529.IsPlainObject(bs3));
                Assert.AreEqual(10, bs3.field1);
                Assert.AreEqual("test5", bs3.field2);

                var ds1 = new DS {
                    field = 9
                };

                Assert.True(Bridge1529.IsPlainObject(ds1));
                Assert.AreEqual(9, ds1.field);
                Assert.AreEqual(10, ds1.field1);
                Assert.AreEqual("test", ds1.field2);
                Assert.AreEqual(0, ds1.Prop1);

                var ts = new TS();

                Assert.True(Bridge1529.IsPlainObject(ts));
                Assert.AreEqual(8, ts.field1);
            }
Example #11
0
 public PolicyHolder()
 {
     this.policyHolderPersonName      = new PNImpl();
     this.policyHolderPersonBirthTime = new TSImpl();
 }
Example #12
0
 public CreatedBy_2()
 {
     this.time          = new TSImpl();
     this.modeCode      = new CVImpl();
     this.signatureText = new EDImpl <String>();
 }
Example #13
0
 public string GetLongTimeString(TS ts)
 {
     return
         ($"{ts.Time.Year}{ts.Time.Month:d2}{ts.Time.Day:d2}{ts.Time.Hour:d2}{ts.Time.Minute:d2}{ts.Time.Second:d2}+0000");
 }
Example #14
0
 public AuthoredBy_1()
 {
     this.time = new TSImpl();
 }
Example #15
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     TS.AddInterval(S, S + TimeSpan.FromSeconds(60));
     S += TimeSpan.FromSeconds(40);
 }
Example #16
0
 public RefusedBy()
 {
     this.time          = new TSImpl();
     this.modeCode      = new CVImpl();
     this.signatureText = new EDImpl <String>();
 }
Example #17
0
 static void MessageManager_ReceiveVibration(object sender, TS.QQ.Events.QQEventArgs<ReceiveIMPacket, OutPacket> e)
 {
     Echo(string.Format("收到好友 {0}[{1}] 振动", e.InPacket.Header.Sender, Client.QQUser.Friends[(int)e.InPacket.Header.Sender].Nick));
 }
Example #18
0
 private static void MessageManager_ReceiveNormalIM(object sender, TS.QQ.Events.QQEventArgs<ReceiveIMPacket, OutPacket> e)
 {
     if (back == "T")
     {
         Echo(string.Format("{1}[{2}] 说:{3}", new object[] { Util.GetDateTimeFromMillis(e.InPacket.NormalHeader.SendTime), e.InPacket.Header.Sender, e.QQClient.QQUser.Friends[e.InPacket.Header.Sender].Nick, e.InPacket.NormalIM.Message }));
     }
     string lxid = "0";
     string qunid = "0";
     string qunnid = "0";
     string nick = e.QQClient.QQUser.Friends[e.InPacket.Header.Sender].Nick;
     string str5 = e.InPacket.Header.Sender.ToString();
     string message = e.InPacket.NormalIM.Message;
     if (AutoReply == "start")
     {
         web(lxid, qunid, qunnid, str5, nick, message);
         if (returncode != "")
         {
             SendMsg(e.InPacket.NormalHeader.Sender, returncode);
         }
     }
     else if (str5 == adminqq)
     {
         web(lxid, qunid, qunnid, str5, nick, message);
         if (returncode != "")
         {
             SendMsg(e.InPacket.NormalHeader.Sender, returncode);
         }
     }
     else
     {
         Echo("自动回复已关闭!您的消息无法回答!");
     }
 }
Example #19
0
 static void MessageManager_ReceiveKickOut(object sender, TS.QQ.Events.QQEventArgs<ReceiveIMPacket, OutPacket> e)
 {
     Client.LoginStatus = LoginStatus.Logout;
     Echo(e.InPacket.SysMessage);
 }
Example #20
0
 static void LoginManager_LoginStatusChanged(object sender, TS.QQ.Events.LoginStatusChangedEventArgs<LoginStatus> e)
 {
     if (e.LoginStatus == LoginStatus.ChangeServer)
     {
         Echo(e.LoginStatus.ToString()+":"+Client.LoginServerHost);
     }else
     Echo(e.LoginStatus.ToString());
 }
Example #21
0
 static void LoginManager_LoginNeedVerifyCode(object sender, TS.QQ.Events.QQEventArgs<TS.QQ.Packets.In.LoginRequestReplyPacket, TS.QQ.Packets.Out.LoginRequestPacket> e)
 {
     Console.Write("请输入验证码("+e.InPacket.CodeFileName+"):");
     string code=Console.ReadLine();
     e.QQClient.LoginManager.LoginSendVerifyCode(code);
 }
Example #22
0
 //修改签名成功
 static void FriendManager_ModifySignatureSuccessed(object sender,   TS.QQ.Events.QQEventArgs<SignatureOpReplyPacket, SignatureOpPacket> e)
 {
     Echo("签名修改成功!");
 }
Example #23
0
        static void Main(string[] args)
        {
            // This layer of the Everest Framework maps 1:1 with the underlying HL7v3 structures, so it requires a detailed understanding of HL7v3
            // This example shows some of the Mohawk Everest Framework features, such as:
            //
            //     - overloaded constructors
            //     - structural validation
            //     - vocabulary support with enumerations
            //     - smart datatype support with helper methods
            //     - intellisense support including MIF documentation pass-thru
            //     - built-in XML ITS formatting
            //     - and other features (see API documentation)
            //
            // Higher levels of an API Framework would provide abstraction from these message details
            //


            // Create a client registry "find candidates query" message structure using the required parameters constructor
            // This constructor looks complicated at first, but it ensures that all required elements are present in the message structure

            PRPA_IN101103CA FindCandidatesStructure = new PRPA_IN101103CA(                       // use the required elements version of the constructor
                new MARC.Everest.DataTypes.II(new Guid("6AE2BD87-332A-3B99-4EAD-FAF9CE012843")), // message id
                new DateTime(2009, 03, 14, 19, 58, 55, 218),
                ResponseMode.Immediate,                                                          // response mode selected from enumeration
                new MARC.Everest.DataTypes.II("2.16.840.1.113883.1.18", "PRPA_IN101103CA"),      // interaction id
                new MARC.Everest.DataTypes.LIST <II>()
            {
                new MARC.Everest.DataTypes.II("2.16.840.1.113883.2.20.2", "R02.04.00")
            },                                                                     // profileID
                new CS <ProcessingID>(ProcessingID.Debugging),                     // processing ID code
                new CS <AcknowledgementCondition>(AcknowledgementCondition.Never), // ack type
                new MARC.Everest.RMIM.CA.R020401.MCCI_MT002300CA.Receiver(
                    new MARC.Everest.RMIM.CA.R020401.MCCI_MT002300CA.Device2(new II("2.16.840.1.113883.19.3.297.15.37.0.47", "DIS01"))),
                new MARC.Everest.RMIM.CA.R020401.MCCI_MT002300CA.Sender(
                    new MARC.Everest.RMIM.CA.R020401.MCCI_MT002300CA.Device1(new II("2.16.840.1.113883.19.3.207.15.1.0.3", "DIS01"))));


            // prepare a coded value representing the trigger event - this will be attached to the control act event
            CV <String> triggerevent = new CV <String>()
            {
                Code = "PRPA_TE101103CA", CodeSystem = "2.16.840.1.113883.1.18"
            };

            // Create the control act event required for this message and attach it to the structure
            // Since this is a "Query" interaction type, we create a QueryByParameter structure and attach it to the control act
            // We will later fill in this query block with our specific parameters
            FindCandidatesStructure.controlActEvent = PRPA_IN101103CA.CreateControlActEvent(
                new II("2.16.840.1.113883.19.3.207.15.1.1", "0245285594892"),
                triggerevent,
                new MARC.Everest.RMIM.CA.R020401.MFMI_MT700751CA.Author(new TS(DateTime.Parse("2009-03-14 19:58:55.218"))),
                new MARC.Everest.RMIM.CA.R020401.MFMI_MT700746CA.QueryByParameter <MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.ParameterList>(
                    II.CreateToken(Guid.NewGuid()),
                    new MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.ParameterList()
                    ));


            // add the name to search for and attach it to the parameter list
            List <ENXP> namelist = new List <ENXP>();

            namelist.Add(new ENXP("Nuclear", EntityNamePartType.Family));
            namelist.Add(new ENXP("Nancy", EntityNamePartType.Given));

            PN pn1 = new PN(namelist);

            MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.PersonName persname = new MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.PersonName(pn1);
            // notice we use .Add() to attach a name to the parameter list - this is due to the fact that a person name is actually a list of names
            FindCandidatesStructure.controlActEvent.QueryByParameter.parameterList.PersonName.Add(persname);


            // add the birthday to search for and add it to the parameter list
            TS birthdate = new TS(new DateTime(1990, 1, 1));

            MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.PersonBirthtime pbt = new MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.PersonBirthtime(birthdate);
            // notice we use assignment to attach the populated object pdt (no .Add() method as above since it is a simple object -- see PersonName.Add() for contrasting example)
            FindCandidatesStructure.controlActEvent.QueryByParameter.parameterList.PersonBirthtime = pbt;

            FindCandidatesStructure.controlActEvent.LanguageCode = new CE <string>()
            {
                NullFlavor = MARC.Everest.DataTypes.NullFlavor.AskedUnknown
            };

            // Create an XML formatter
            XmlIts1Formatter its1Formatter = new XmlIts1Formatter();

            // Add the datatypes R1 graph aide
            its1Formatter.GraphAides.Add(new DatatypeFormatter());

            // Check the structure for conformance by forcing the formatter to render to a memory stream
            // Result.Code will then indicate if the message is conformant
            var Result = its1Formatter.Graph(new MemoryStream(), FindCandidatesStructure);

            if (Result.Code == MARC.Everest.Connectors.ResultCode.AcceptedNonConformant)
            {
                // we have a conformant message, so let's save it

                // print the XML to STDOUT
                its1Formatter.Graph(Console.OpenStandardOutput(), FindCandidatesStructure);

                // if we stream it through an XML writer and set the indent property the output will contain line breaks and indentation which makes it much easier to read (not necessaily required for machine-machine transmission)
                System.Xml.XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent = true;
                XmlWriter x = XmlWriter.Create(@"PRPA_IN101103CA_Everest.xml", settings);
                // XmlStateWriter is required here to get around some complicated formatting issues
                MARC.Everest.Xml.XmlStateWriter sw = new MARC.Everest.Xml.XmlStateWriter(x);
                its1Formatter.Graph(sw, FindCandidatesStructure);
                sw.Flush();
            }
            else
            {
                Console.WriteLine("Error trying to save structure PRPA_IN101103CA. Formatter response: {0}", Result.Code.ToString());
            }

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }
Example #24
0
 public Author1()
 {
     this.time     = new TSImpl();
     this.modeCode = new CVImpl();
 }
Example #25
0
 internal void SetBirthTime(TS value)
 {
     birthTime = new TS();
     birthTime = value;
 }
Example #26
0
 static void MessageManager_SysAddedByOthers(object sender, TS.QQ.Events.QQEventArgs<SystemNotificationPacket, OutPacket> e)
 {
     Echo(string.Format("{0} 加你为好友.",e.InPacket.From));
 }
        public void FillSeriesDateArray(
                    int connectionNumber, String tableName, String traceTableName, int id,
                    int nReqValues, DateTime[] dateArray, DateTime reqStartDate)
        {
            // Get the connection that we'll pass along.
            SqlConnection connx = GetConnectionFromId(connectionNumber);
            // Construct new TS object with SqlConnection object and table name
            TS ts = new TS(connx, ConnxObject, tableName, traceTableName);

            ts.FillDateArray(id, nReqValues, dateArray, reqStartDate);
        }
Example #28
0
 static void MessageManager_SysAddOtherApproved(object sender, TS.QQ.Events.QQEventArgs<SystemNotificationPacket, OutPacket> e)
 {
     Echo(string.Format("{0} 通过您的认证", e.InPacket.From));
 }
Example #29
0
 internal void SetBirthTime(TS value)
 {
     birthTime = new TS();
     birthTime = value;
 }
Example #30
0
 static void MessageManager_SysAddOtherRejected(object sender, TS.QQ.Events.QQEventArgs<SystemNotificationPacket, OutPacket> e)
 {
     Echo(string.Format("{0} 拒绝加你为好友,附加消息:{1}", e.InPacket.From,e.InPacket.Message));
 }
Example #31
0
 public string GetShortTimeString(TS ts)
 {
     return($"{ts.Time.Year}{ts.Time.Month:d2}{ts.Time.Day:d2}");
 }
Example #32
0
 static void MessageManager_SysApprovedAddOtherAndAddMe(object sender, TS.QQ.Events.QQEventArgs<SystemNotificationPacket, OutPacket> e)
 {
     Echo(string.Format("{0} 通过你的请求,并加你为好友", e.InPacket.From));
     //TS.QQ.Entities.QQFriend friend = new TS.QQ.Entities.QQFriend();
     //friend.QQBasicInfo.QQ = e.InPacket.From;
     e.QQClient.QQUser.Friends.Add(e.InPacket.From).FriendStatus.Status = QQStatus.我在线上;
 }
Example #33
0
        public bool Render(TypeScriptModuleContext context, Fragment fragment, IndentedTextWriter writer)
        {
            if (!(fragment is ObjectFragment objectFragment))
            {
                return(false);
            }

            if (objectFragment.Hints.TryGetValue("source-type", out var sourceType))
            {
                writer.WriteIndentedLine($"// source: {sourceType}");
                writer.WriteSeparatingLine();
            }

            var genericSuffix = string.Join(", ", objectFragment.GenericArguments.Select(a => a.Name));

            using (writer.WriteIndentedBlock(prefix: $"class {objectFragment.Name}{(genericSuffix.Length > 0 ? $"<{genericSuffix}>" : "")} "))
            {
                foreach (var field in objectFragment.Fields)
                {
                    context.Import("mobx", "observable");

                    writer.WriteIndentedLine("@observable.ref");
                    writer.WriteIndentedLine($"{TS.Field(field.Name)}: {context.Resolve(field.Type)};");
                    writer.WriteSeparatingLine();
                }

                if (objectFragment.GenericArguments.Any())
                {
                    var genericParameters = $"<{string.Join(", ", objectFragment.GenericArguments.Select(a => a.Name))}>";
                    var factoryParameters = string.Join(", ", objectFragment.GenericArguments.Select(a => $"{a.Name}_factory: {{ create(source: any): {a.Name} }}"));

                    using (writer.WriteIndentedBlock(prefix: $"static create{genericParameters}({factoryParameters}): {{ create: (source: any) => {objectFragment.Name}{genericParameters} }} "))
                    {
                        using (writer.WriteIndentedBlock(prefix: $"return ", suffix: ";"))
                        {
                            using (writer.WriteIndentedBlock(prefix: $"create: (source: any) => "))
                            {
                                writer.WriteIndentedLine($"const result = new {objectFragment.Name}{genericParameters}();");
                                foreach (var field in objectFragment.Fields)
                                {
                                    writer.WriteIndentedLine($"result.{TS.Field(field.Name)} = {context.CreateExpression(field.Type, $"source.{TS.Field(field.Name)}")};");
                                }
                                writer.WriteIndentedLine("return result;");
                            }
                        }
                    }
                }
                else
                {
                    using (writer.WriteIndentedBlock(prefix: $"static create(source: any): {objectFragment.Name} "))
                    {
                        writer.WriteIndentedLine($"const result = new {objectFragment.Name}();");
                        foreach (var field in objectFragment.Fields)
                        {
                            writer.WriteIndentedLine($"result.{TS.Field(field.Name)} = {context.CreateExpression(field.Type, $"source.{TS.Field(field.Name)}")};");
                        }
                        writer.WriteIndentedLine("return result;");
                    }
                }
            }

            context.Export(objectFragment.Name, @default: true);

            return(true);
        }
Example #34
0
 static void MessageManager_SysRequestAddMe(object sender, TS.QQ.Events.QQEventArgs<SystemNotificationPacket, OutPacket> e)
 {
     Echo(string.Format("{0} 加你为好友,附加消息:{1}\n输入 -add {0} 命令加{0}为好友", e.InPacket.From, e.InPacket.Message));
 }
Example #35
0
        private void RunFile()
        {
            TS    TabelaSimbolos = new TS();
            Token token;

            textOutput.Clear();
            textError.Clear();

            if (tabControl1.TabPages.Count <= 0)
            {
                return;
            }

            CustomTab customTab = (CustomTab)tabControl1.TabPages[tabControl1.SelectedIndex];

            customTab.panelError.getRichOutput.Text = "";
            customTab.panelError.getRichError.Text  = "";

            if (string.IsNullOrEmpty(fileOpenNow))
            {
                SaveFile();
            }

            try
            {
                Analise_Lexica analise = new Analise_Lexica(fileOpenNow, TabelaSimbolos);

                do
                {
                    //chamda parao proximo token que sera lido
                    token = analise.ProximoToken(ref textOutput, ref textError);

                    if (token != null)
                    {
                        //imprime o token com linas e colunas
                        textOutput.Text += "Token: " + token.toString() + "\t Linha: " + analise.linha + "\t Coluna: " + analise.coluna + "\n";
                    }
                } while (token != null && token.Classe != Lexer.Tag.EOF); // do while só para se chegar no fim do arquivo

                textOutput.Text += "\n";
                textOutput.Text += "Tabela de simbolos: \n";
                textOutput.Text += TabelaSimbolos.toString();

                customTab.panelError.getRichOutput.Text = textOutput.Text;
                customTab.panelError.hideError();
                customTab.panelError.showOutput();

                if (!string.IsNullOrEmpty(textError.Text))
                {
                    customTab.panelError.getRichError.Text = textError.Text;
                }
                //customTab.panelError.showError();

                //var outputForm = new OutputForm(this);
                //outputForm.Show();

                //tabControl1.SelectedIndex = tabControl1.TabCount - 1;

                //fecha o arquivo depos de ter terminado a analise
                analise.Fechar_Arquivo();
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #36
0
 static void MessageManager_SysRequestAddMeEx(object sender, TS.QQ.Events.QQEventArgs<SystemNotificationPacket, OutPacket> e)
 {
     if (back == "T")
     {
     Echo(string.Format("{0} 加你为好友,附加消息:{1}\n系统已经自动同意加对方为好友", e.InPacket.From, e.InPacket.Message));//输入 -add {0} 命令加{0}为好友
     }
     //e.QQClient.FriendManager.ApprovedAddMe(e.InPacket.From);
     if (e.InPacket.ReverseAdd == RevenseAdd.Allow)//对方允许添加好友
     {
         e.QQClient.FriendManager.ApprovedAndAdd(e.InPacket.From);
         e.QQClient.FriendManager.AddFriendToList(0, e.InPacket.From);
         //TS.QQ.Entities.QQFriend friend=new TS.QQ.Entities.QQFriend();
         //friend.QQBasicInfo=e.InPacket.From;
         e.QQClient.QQUser.Friends.Add(e.InPacket.From).FriendStatus.Status = QQStatus.我在线上;
         string lxid = "1";
         string qunid = "0";
         string qunnid = "0";
         string nick = e.QQClient.QQUser.Friends[e.InPacket.From].Nick;
         string str5 = e.InPacket.From.ToString();
         string message = e.InPacket.Message;
         web(lxid, qunid, qunnid, str5, nick, message);
         SendMsg(e.InPacket.From, returncode);
     }
     else //走其它添加好友的方式
     {
         e.QQClient.FriendManager.ApprovedAdd(e.InPacket.From);
         //e.QQClient.FriendManager.AddFriendToList(0, e.InPacket.From);
         //e.QQClient.FriendManager.AddFriend(e.InPacket.From);
     }
 }
Example #37
0
 public ChangedBy()
 {
     this.time = new TSImpl();
 }
Example #38
0
 static TS CreateTensor(int width, int size)
 => TS.CreateTensor(new TensorShape(width, size, size), (ind) => ind[0] + ind[1] + ind[2]);
Example #39
0
 public PrescriptionPatientMeasurements()
 {
     this.code          = new CVImpl();
     this.effectiveTime = new TSImpl();
     this.value         = new PQImpl();
 }
Example #40
0
#pragma warning disable IDE0044 // Add readonly modifier
#pragma warning disable IDE0051 // Remove unused private members

        static TS CreateTensorPar(int width, int size)
        => TS.CreateTensor(new TensorShape(width, size, size), (ind) => ind[0] + ind[1] + ind[2], Threading.Multi);
Example #41
0
 public AdjudicatedInvoiceAuthor()
 {
     this.time = new TSImpl();
 }
Example #42
0
 public RefusalToFills()
 {
     this.effectiveTime            = new TSImpl();
     this.reasonCode               = new CVImpl();
     this.reasonDetectedIssueEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Pharmacy.Merged.Issues>();
 }
        /// <summary>
        /// Responds to action performed events sent by popup menus of the tree nodes. </summary>
        /// <param name="event"> the ActionEvent that happened. </param>
        public virtual void actionPerformed(ActionEvent @event)
        {
            string action  = @event.getActionCommand();
            string routine = "StateMod_DataSet_JTree.actionPerformed";

            object data = __popup_Node.getData();

            if (data is DataSetComponent)
            {
                DataSetComponent comp = (DataSetComponent)data;
                int comp_type         = comp.getComponentType();
                if (comp_type == StateMod_DataSet.COMP_CONTROL_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_CONTROL, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_STREAMGAGE_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMGAGE, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_DELAY_TABLE_MONTHLY_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_MONTHLY, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_DELAY_TABLE_DAILY_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_DAILY, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_DIVERSION_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DIVERSION, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_PRECIPITATION_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_PRECIPITATION, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_EVAPORATION_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_EVAPORATION, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_RESERVOIR_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_RESERVOIR, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_INSTREAM_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_INSTREAM, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_WELL_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_WELL, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_PLAN_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_PLAN, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_STREAMESTIMATE_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMESTIMATE, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_RIVER_NETWORK_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_RIVER_NETWORK, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_OPERATION_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_OPERATIONAL_RIGHT, __editable);
                }
            }
            // Below here are specific instances of objects.  Similar to above,
            // display the main window but then also select the specific object...
            else if (data is StateMod_StreamGage)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMGAGE, __editable);
                ((StateMod_StreamGage_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMGAGE)).selectID(((StateMod_StreamGage)data).getID());
            }
            else if (data is StateMod_DelayTable)
            {
                StateMod_DelayTable dt = (StateMod_DelayTable)data;
                if (dt.isMonthly())
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_MONTHLY, __editable);
                    ((StateMod_DelayTable_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_MONTHLY)).selectID(dt.getID());
                }
                else
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_DAILY, __editable);
                    ((StateMod_DelayTable_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_DAILY)).selectID(dt.getID());
                }
            }
            else if (data is StateMod_Diversion)
            {
                if (action.IndexOf(__SUMMARIZE_HOW1, StringComparison.Ordinal) >= 0)
                {
                    PropList props = new PropList("Diversion");
                    props.set("Title=" + ((StateMod_Diversion)data).getID() + " Diversion use in Data Set");
                    new ReportJFrame(__dataset.getDataObjectDetails(StateMod_DataSet.COMP_DIVERSION_STATIONS, ((StateMod_Diversion)data).getID()), props);
                }
                else
                {
                    // Assume properties...
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DIVERSION, __editable);
                    ((StateMod_Diversion_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_DIVERSION)).selectID(((StateMod_Diversion)data).getID());
                }
            }
            else if (data is TS)
            {
                // Might be precipitation or evaporation.  Check the data type to determine...
                TS       ts    = (TS)data;
                PropList props = new PropList("Precipitation/Evaporation");
                if (action.IndexOf(__SUMMARIZE_HOW1, StringComparison.Ordinal) >= 0)
                {
                    if (StringUtil.startsWithIgnoreCase(ts.getDataType(), "e"))
                    {
                        props.set("Title=" + ts.getLocation() + " Evaporation TS use in Data Set");
                        new ReportJFrame(__dataset.getDataObjectDetails(StateMod_DataSet.COMP_EVAPORATION_TS_MONTHLY, ts.getLocation()), props);
                    }
                    else if (StringUtil.startsWithIgnoreCase(ts.getDataType(), "p"))
                    {
                        props.set("Title=" + ts.getLocation() + " Precipitation TS use in Data Set");
                        new ReportJFrame(__dataset.getDataObjectDetails(StateMod_DataSet.COMP_PRECIPITATION_TS_MONTHLY, ts.getLocation()), props);
                    }
                }
                else if (action.IndexOf(__PROPERTIES, StringComparison.Ordinal) >= 0)
                {
                    if (StringUtil.startsWithIgnoreCase(ts.getDataType(), "e"))
                    {
                        props.set("Title=Evaporation");
                    }
                    else if (StringUtil.startsWithIgnoreCase(ts.getDataType(), "p"))
                    {
                        props.set("Title=Precipitation");
                    }
                    props.set("InitialView=Graph");
                    props.set("GraphType=Bar");
                    System.Collections.IList tslist = new List <object>(1);
                    tslist.Add(ts);
                    try
                    {
                        new TSViewJFrame(tslist, props);
                    }
                    catch (Exception)
                    {
                        Message.printWarning(1, routine, "Error displaying data.");
                    }
                }
            }
            else if (data is StateMod_Reservoir)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_RESERVOIR, __editable);
                ((StateMod_Reservoir_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_RESERVOIR)).selectID(((StateMod_Reservoir)data).getID());
            }
            else if (data is StateMod_InstreamFlow)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_INSTREAM, __editable);
                ((StateMod_InstreamFlow_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_INSTREAM)).selectID(((StateMod_InstreamFlow)data).getID());
            }
            else if (data is StateMod_Well)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_WELL, __editable);
                ((StateMod_Well_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_WELL)).selectID(((StateMod_Well)data).getID());
            }
            else if (data is StateMod_Plan)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_PLAN, __editable);
                ((StateMod_Plan_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_PLAN)).selectID(((StateMod_Plan)data).getID());
            }
            else if (data is StateMod_StreamEstimate)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMESTIMATE, __editable);
                ((StateMod_StreamEstimate_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMESTIMATE)).selectID(((StateMod_StreamEstimate)data).getID());
            }
            else if (data is StateMod_RiverNetworkNode)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_RIVER_NETWORK, __editable);
                ((StateMod_RiverNetworkNode_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_RIVER_NETWORK)).selectID(((StateMod_RiverNetworkNode)data).getID());
            }
            else if (data is StateMod_OperationalRight)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_OPERATIONAL_RIGHT, __editable);
                ((StateMod_OperationalRight_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_OPERATIONAL_RIGHT)).selectID(((StateMod_OperationalRight)data).getID());
            }
        }
Example #44
0
        public bool Render(TypeScriptModuleContext context, Fragment fragment, IndentedTextWriter writer)
        {
            if (!(fragment is EnumFragment enumFragment))
            {
                return(false);
            }

            if (enumFragment.Hints.TryGetValue("source-type", out var sourceType))
            {
                writer.WriteIndentedLine($"// source: {sourceType}");
                writer.WriteSeparatingLine();
            }

            using (writer.WriteIndentedBlock(prefix: $"enum {TS.Type(fragment.Name)} "))
            {
                foreach (var item in enumFragment.Items)
                {
                    writer.WriteIndentedLine($"{TS.Field(item.Name)} = {item.Value},");
                }
            }

            var itemHasDisplayNameHint = enumFragment.Items.Any(i => i.Hints.ContainsKey("display-name"));

            using (writer.WriteIndentedBlock(prefix: $"const names = ", suffix: ";"))
            {
                foreach (var item in enumFragment.Items)
                {
                    writer.WriteIndentedLine($"[{TS.Type(enumFragment.Name)}.{TS.Field(item.Name)}]: {TS.String(TS.Field(item.Name))},");
                }
            }

            if (itemHasDisplayNameHint)
            {
                using (writer.WriteIndentedBlock(prefix: $"const displayNames = ", suffix: ";"))
                {
                    foreach (var item in enumFragment.Items)
                    {
                        writer.WriteIndentedLine($"[{TS.Type(enumFragment.Name)}.{TS.Field(item.Name)}]: {TS.String(item.Hints["display-name"] ?? "")},");
                    }
                }
            }

            using (writer.WriteIndentedBlock(prefix: $"namespace {TS.Type(enumFragment.Name)} "))
            {
                if (enumFragment.Hints.TryGetValue("enum-flags", out var enumFlags) && string.Equals(enumFlags, "true", StringComparison.OrdinalIgnoreCase))
                {
                    writer.WriteIndentedLine($@"export function create(value: any): {TS.Type(enumFragment.Name)} {{
    if (typeof value !== 'number') {{
        throw new Error(`Value '${{value}}' is not valid for enum {TS.Type(enumFragment.Name)}`);
    }}

    let remainder = value;
    for (let k in {TS.Type(enumFragment.Name)}) {{
        const v = {TS.Type(enumFragment.Name)}[k];
        if (!{TS.Type(enumFragment.Name)}.hasOwnProperty(v)) {{
            continue;
        }}

        remainder = remainder & ~v;
    }}

	if (remainder !== 0) {{
		throw new Error(`Remainder '${{remainder}}' of '${{value}}' is not valid for enum {TS.Type(enumFragment.Name)}`);
	}}

	return value as {TS.Type(enumFragment.Name)};
}};");
                }
                else
                {
                    writer.WriteIndentedLine($@"export function create(value: any): {TS.Type(enumFragment.Name)} {{
	if (!{TS.Type(enumFragment.Name)}.hasOwnProperty(value)) {{
		throw new Error(`Value '${{value}}' is not valid for enum {TS.Type(enumFragment.Name)}`);
	}}

	return value as {TS.Type(enumFragment.Name)};
}}");
                }
                writer.WriteSeparatingLine();

                using (writer.WriteIndentedBlock(prefix: $"export function getValues(): {TS.Type(enumFragment.Name)}[] "))
                {
                    using (writer.WriteIndentedBlock(prefix: "return ", open: "[", close: "]", suffix: ";"))
                    {
                        foreach (var item in enumFragment.Items)
                        {
                            writer.WriteIndentedLine($"{TS.Type(enumFragment.Name)}.{TS.Field(item.Name)},");
                        }
                    }
                }

                using (writer.WriteIndentedBlock(prefix: $"export function getNames(): string[] "))
                {
                    using (writer.WriteIndentedBlock(prefix: "return ", open: "[", close: "]", suffix: ";"))
                    {
                        foreach (var item in enumFragment.Items)
                        {
                            writer.WriteIndentedLine($"{TS.String(TS.Field(item.Name))},");
                        }
                    }
                }

                writer.WriteIndentedLine($@"export function getName(value: {TS.Type(enumFragment.Name)}): string {{
	const name = names[value];

	if (name === undefined) {{
		throw new Error(`Cannot get name of {TS.Type(enumFragment.Name)} '${{value}}'`);
	}}

	return name;
}}");
                writer.WriteSeparatingLine();

                if (itemHasDisplayNameHint)
                {
                    writer.WriteIndentedLine($@"export function getDisplayName(value: {TS.Type(enumFragment.Name)}): string {{
	const displayName = displayNames[value];

	if (displayName === undefined) {{
		throw new Error(`Cannot get display name of {TS.Type(enumFragment.Name)} '${{value}}'`);
	}}

	return displayName;
}}");
                    writer.WriteSeparatingLine();
                }
            }

            context.Export(enumFragment.Name, @default: true);

            return(true);
        }
        /// <summary>
        /// This method deletes a record for a single time series from the database, using the
        /// given database connection number and database table name.
        /// </summary>
        /// <param name="connectionNumber">The serial number of the connection that is used to access the time series</param>
        /// <param name="tableName">The name of the database table that time series will be deleted from</param>
        /// <param name="traceTableName">The name of the database table that stores the BLOB for a single trace</param>
        /// <param name="id">The ID identifying the record to delete</param>
        /// <returns>true if a record was deleted, false if no records were deleted</returns>
        public bool DeleteSeries(
                int connectionNumber, String tableName, String traceTableName, int id)
        {
            // Get the connection that we'll pass along.
            SqlConnection connx = GetConnectionFromId(connectionNumber);
            // Construct new TS object with SqlConnection object and table name
            TS ts = new TS(connx, ConnxObject, tableName, traceTableName);

            return ts.DeleteSeries(id);
        }
Example #46
0
 /// <summary>
 /// Set the 'Effective Time' for the document - i.e. the time the documet was created.
 /// </summary>
 /// <param name="dateTime">The date/time</param>
 public void SetEffectiveTime(DateTime dateTimeValue)
 {
     effectiveTime = new TS(dateTimeValue);
     effectiveTime.DateValuePrecision = DatePrecision.Second;
 }
Example #47
0
 public Transcriber()
 {
     this.time = new TSImpl();
 }
Example #48
0
        static void Main(string[] args)
        {

            // This layer of the Everest Framework maps 1:1 with the underlying HL7v3 structures, so it requires a detailed understanding of HL7v3
            // This example shows some of the Mohawk Everest Framework features, such as:
            //
            //     - overloaded constructors
            //     - structural validation
            //     - vocabulary support with enumerations
            //     - smart datatype support with helper methods
            //     - intellisense support including MIF documentation pass-thru
            //     - built-in XML ITS formatting 
            //     - and other features (see API documentation)
            //
            // Higher levels of an API Framework would provide abstraction from these message details 
            // 


            // Create a client registry "find candidates query" message structure using the required parameters constructor
            // This constructor looks complicated at first, but it ensures that all required elements are present in the message structure

            PRPA_IN101103CA FindCandidatesStructure = new PRPA_IN101103CA( // use the required elements version of the constructor
                           new MARC.Everest.DataTypes.II(new Guid("6AE2BD87-332A-3B99-4EAD-FAF9CE012843")), // message id
                           new DateTime(2009, 03, 14, 19, 58, 55, 218), 
                           ResponseMode.Immediate, // response mode selected from enumeration
                           new MARC.Everest.DataTypes.II("2.16.840.1.113883.1.18", "PRPA_IN101103CA"), // interaction id
                           new MARC.Everest.DataTypes.LIST<II>() { new MARC.Everest.DataTypes.II("2.16.840.1.113883.2.20.2", "R02.04.00") }, // profileID
                           new CS<ProcessingID>(ProcessingID.Debugging), // processing ID code
                           new CS<AcknowledgementCondition>(AcknowledgementCondition.Never), // ack type
                           new MARC.Everest.RMIM.CA.R020401.MCCI_MT002300CA.Receiver(
                               new MARC.Everest.RMIM.CA.R020401.MCCI_MT002300CA.Device2(new II("2.16.840.1.113883.19.3.297.15.37.0.47", "DIS01"))),
                           new MARC.Everest.RMIM.CA.R020401.MCCI_MT002300CA.Sender(
                               new MARC.Everest.RMIM.CA.R020401.MCCI_MT002300CA.Device1(new II("2.16.840.1.113883.19.3.207.15.1.0.3", "DIS01"))));


            // prepare a coded value representing the trigger event - this will be attached to the control act event
            CV<String> triggerevent = new CV<String>() { Code = "PRPA_TE101103CA", CodeSystem = "2.16.840.1.113883.1.18" };

            // Create the control act event required for this message and attach it to the structure
            // Since this is a "Query" interaction type, we create a QueryByParameter structure and attach it to the control act
            // We will later fill in this query block with our specific parameters
            FindCandidatesStructure.controlActEvent = PRPA_IN101103CA.CreateControlActEvent(
                new II("2.16.840.1.113883.19.3.207.15.1.1", "0245285594892"),
                triggerevent,
                new MARC.Everest.RMIM.CA.R020401.MFMI_MT700751CA.Author(new TS(DateTime.Parse("2009-03-14 19:58:55.218"))),
                new MARC.Everest.RMIM.CA.R020401.MFMI_MT700746CA.QueryByParameter<MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.ParameterList>(
                    II.CreateToken(Guid.NewGuid()),
                    new MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.ParameterList()
                ));
                

            // add the name to search for and attach it to the parameter list
            List<ENXP> namelist = new List<ENXP>();  
            
            namelist.Add(new ENXP("Nuclear", EntityNamePartType.Family));
            namelist.Add(new ENXP("Nancy", EntityNamePartType.Given));

            PN pn1 = new PN(namelist);
            MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.PersonName persname = new MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.PersonName(pn1);
            // notice we use .Add() to attach a name to the parameter list - this is due to the fact that a person name is actually a list of names
            FindCandidatesStructure.controlActEvent.QueryByParameter.parameterList.PersonName.Add(persname);


            // add the birthday to search for and add it to the parameter list
            TS birthdate = new TS(new DateTime(1990, 1, 1));
            MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.PersonBirthtime pbt = new MARC.Everest.RMIM.CA.R020401.PRPA_MT101103CA.PersonBirthtime(birthdate);
            // notice we use assignment to attach the populated object pdt (no .Add() method as above since it is a simple object -- see PersonName.Add() for contrasting example)
            FindCandidatesStructure.controlActEvent.QueryByParameter.parameterList.PersonBirthtime = pbt;

            FindCandidatesStructure.controlActEvent.LanguageCode = new CE<string>() { NullFlavor = MARC.Everest.DataTypes.NullFlavor.AskedUnknown };

            // Create an XML formatter
            XmlIts1Formatter its1Formatter = new XmlIts1Formatter();
            // Add the datatypes R1 graph aide
            its1Formatter.GraphAides.Add(new DatatypeFormatter());

            // Check the structure for conformance by forcing the formatter to render to a memory stream
            // Result.Code will then indicate if the message is conformant
            var Result = its1Formatter.Graph(new MemoryStream(), FindCandidatesStructure);

            if (Result.Code == MARC.Everest.Connectors.ResultCode.AcceptedNonConformant)
            {
                // we have a conformant message, so let's save it

                // print the XML to STDOUT
                its1Formatter.Graph(Console.OpenStandardOutput(), FindCandidatesStructure);

                // if we stream it through an XML writer and set the indent property the output will contain line breaks and indentation which makes it much easier to read (not necessaily required for machine-machine transmission)
                System.Xml.XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent = true;
                XmlWriter x = XmlWriter.Create(@"PRPA_IN101103CA_Everest.xml", settings);
                // XmlStateWriter is required here to get around some complicated formatting issues
                MARC.Everest.Xml.XmlStateWriter sw = new MARC.Everest.Xml.XmlStateWriter(x);
                its1Formatter.Graph(sw, FindCandidatesStructure);
                sw.Flush();
            }
            else
            {
                Console.WriteLine("Error trying to save structure PRPA_IN101103CA. Formatter response: {0}", Result.Code.ToString());
            }

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();


            
        }
Example #49
0
 public Notes()
 {
     this.text       = new STImpl();
     this.authorTime = new TSImpl();
 }
Example #50
0
 public PaymentIntent()
 {
     this.effectiveTime = new TSImpl();
     this.amt           = new MOImpl();
 }
        public void SetAuthorTemplate(NPFIT_000081_Role template, DateTime timeValue)
        {
            TS newTime = new TS(timeValue);

            AddAuthor(template, newTime);
        }
        /// <summary>
        /// Displays a graph for a time series. </summary>
        /// <param name="ts"> the time series to graph. </param>
        /// <param name="props"> props defining how the graph should be shown </param>
        /// <param name="dataset"> the dataset in which the ts data exists </param>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public static void displayGraphForTS(RTi.TS.TS ts, RTi.Util.IO.PropList props, StateMod_DataSet dataset) throws Exception
        public static void displayGraphForTS(TS ts, PropList props, StateMod_DataSet dataset)
        {
            System.Collections.IList v = new List <object>();
            v.Add(ts);
            displayGraphForTS(v, props, dataset);
        }
Example #53
0
 public RequestedBy()
 {
     this.time          = new TSImpl();
     this.signatureCode = new CVImpl();
 }
Example #54
0
 public AnnotatedBy()
 {
     this.time = new TSImpl();
 }
Example #55
0
        public void PIVL_ConstainsTest01()
        {
            // Find a time that is a Saturday like Saturday November 12, 2011
            // and repeat it every week
            PIVL<TS> saturdays = new PIVL<TS>
            (
                new TS(new DateTime(2011, 11, 12), DatePrecision.Day).ToIVL(),
                new PQ(1, "wk")
            );
            
            // Determine if November 19, 2011 is a member of the PIVL
            // and if December 20, 2011 is a member

            TS nov19 = new TS(new DateTime(2011, 11, 19), DatePrecision.Day),
                dec20 = new TS(new DateTime(2011, 12, 20), DatePrecision.Day);

            // outout the date and the result of the contains function
            Console.WriteLine("'{0}' a Saturday? {1}\r\n'{2} a Saturday? {3}",
                nov19.DateValue,
                saturdays.Contains(nov19),
                dec20.DateValue,
                saturdays.Contains(dec20)
                );

            Assert.IsTrue(saturdays.Validate());
        }
Example #56
0
 public IssueManagements()
 {
     this.code       = new CVImpl();
     this.text       = new STImpl();
     this.authorTime = new TSImpl();
 }
 internal void AddAuthor(NPFIT_000081_Role template, TS time)
 {
     if (author == null)
     {
         author = new p_author_000081();
     }
     author.AuthorTime = time;
     author.AuthorTime.DateValuePrecision = DatePrecision.Second;
     author.TemplateId = TEMPLATEID;
     author.Role = template;
 }
Example #58
0
 public override void Deposit(float amount)
 {
     base.Deposit(amount);
     TS.Add(new TransactionInfo(0, amount));
 }
 internal p_encounterParticipant_000089(TS authorTime)
     : base()
 {
     base.typeCode = "AUT";
     base.time = new IVL<TS>(authorTime);
 }
Example #60
0
        public static void AddOrUpdate(TS trainService)
        {
            var dict = _database[trainService.ssd.Ticks];

            dict.AddOrUpdate(trainService.rid, new TrainService(trainService), (key, value) => { value.Update(trainService); return(value); });
        }