Example #1
0
        public override bool Submit(SEConnection connection)
        {
            XmlWriterSettings settings = new XmlWriterSettings();

            settings.Indent   = false;
            settings.Encoding = new UTF8Encoding(false);
            using (MemoryStream output = new MemoryStream())
            {
                using (var writer = XmlWriter.Create(output, settings))
                {
                    writer.WriteStartDocument();
                    writer.WriteStartElement("Telegram");
                    writer.WriteAttributeString("xmlns", "xsd", null, "http://www.w3.org/2001/XMLSchema");
                    writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
                    writer.WriteStartElement("Request");
                    writer.WriteAttributeString("requestType", "setup.import");
                    writer.WriteAttributeString("requestId", GetRequestId().ToString());
                    {
                        string content    = Encoding.UTF8.GetString(Table);
                        string unformated = XElement.Parse(content).ToString(SaveOptions.DisableFormatting);
                        Console.WriteLine(unformated);

                        writer.WriteRaw(unformated);
                    }
                    writer.WriteEndElement();
                    writer.WriteEndDocument();
                }
                connection.Write(output.ToArray());
            }
            return(true);
        }
Example #2
0
 public SEClient(SEConnection connection)
 {
     m_commandDispatcher = new CommandDispatcher(connection);
     m_seResult          = new SEResult();
     m_commandDispatcher.Subscribe(m_seResult);
     m_jobId = -1;
 }
Example #3
0
        public override bool Submit(SEConnection connection)
        {
            MT.pHLab.SE.V1.SESimpleRequest request = new MT.pHLab.SE.V1.SESimpleRequest(GetRequestId(), "connection.getStatus");
            connection.Write(request.CreateTelegram());

            return(true);
        }
Example #4
0
        public override bool Submit(SEConnection connection)
        {
            MT.pHLab.SE.V1.SEParamRequest request = new MT.pHLab.SE.V1.SEParamRequest(GetRequestId());
            var record = m_request;

            connection.Write(request.CreateTelegram(record));
            return(true);
        }
Example #5
0
        public override bool Submit(SEConnection connection)
        {
            MT.pHLab.SE.V1.SEParamRequest request = new MT.pHLab.SE.V1.SEParamRequest(GetRequestId());
            var record = new MT.pHLab.SE.V1.Request_getSettingRecord();

            record.m_settingName = Setting;
            connection.Write(request.CreateTelegram(record));
            return(true);
        }
Example #6
0
        public override bool Submit(SEConnection connection)
        {
            MT.pHLab.SE.V1.SEParamRequest request = new MT.pHLab.SE.V1.SEParamRequest(GetRequestId());
            var record = new MT.pHLab.SE.V1.Request_setupGetItemListRecord();

            record.m_itemType = "Sensors";
            connection.Write(request.CreateTelegram(record));
            return(true);
        }
Example #7
0
        public override bool Submit(SEConnection connection)
        {
            MT.pHLab.SE.V1.SEParamRequest request = new MT.pHLab.SE.V1.SEParamRequest(GetRequestId());
            var record = new MT.pHLab.SE.V1.Request_setupExportRecord();

            record.m_itemGroup = m_eItemType.ToString();
            record.m_itemName  = "";
            connection.Write(request.CreateTelegram(record));
            return(true);
        }
Example #8
0
        public override bool Submit(SEConnection connection)
        {
            MT.pHLab.SE.V1.SEParamRequest request = new MT.pHLab.SE.V1.SEParamRequest(GetRequestId());
            var record = new MT.pHLab.SE.V1.Request_methodParamsRecord();

            record.m_methodId = MethodId;
            record.m_sampleId = SampleId;
            record.m_comment  = Comment;
            connection.Write(request.CreateTelegram(record));
            return(true);
        }
Example #9
0
        /*
         * <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
         * <Telegram xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="LancePlatform">
         * <Request requestId="132440" requestType="login">
         *  <record type="Request_loginRecord">
         *    <param-list>
         *      <param name="m_usernames" type="sequence" sequenceType="wstring">
         *        <item>Tom</item>
         *        <item>Jerry</item>
         *        <item>Alex</item>
         *      </param>
         *    </param-list>
         *  </record>
         * </Request>
         * </Telegram>
         * */

        public override bool Submit(SEConnection connection)
        {
            MT.pHLab.SE.V1.SEParamRequest request = new MT.pHLab.SE.V1.SEParamRequest(GetRequestId());
            var record = new MT.pHLab.SE.V1.Request_loginRecord();

            if (Usererlist != null)
            {
                record.m_usernames = Usererlist;
            }
            else
            {
                record.m_usernames = new string[] { };
            }
            connection.Write(request.CreateTelegram(record));
            return(true);
        }
Example #10
0
 public CommandDispatcher(SEConnection connection)
 {
     m_connection            = connection;
     m_connection.OnTelegram = new OnTelegramDelegate(this.OnTelegram);
     m_commandList           = new List <AbstractCommand>();
 }
Example #11
0
 public abstract bool Submit(SEConnection connection);