コード例 #1
0
 internal CsvSaver(ZomBUrl url)
 {
     var urlPath = url.Path.Substring(1);//remove first char
     if (urlPath == "")
         fpath = BTZomBFingerFactory.DefaultSaveLocation + "\\ZCapture" + (DateTime.Now.Ticks.ToString("x")) + ".csv";
     else if (!urlPath.Contains(":\\"))//not absoloute
         fpath = BTZomBFingerFactory.DefaultSaveLocation + "\\" + urlPath;
     else
         fpath = urlPath;
 }
コード例 #2
0
 internal CsvSource(ZomBUrl url)
 {
     var urlPath = url.Path.Substring(1);//remove first char
     if (urlPath == "")
         throw new ArgumentNullException("Path required!");
     else if (!urlPath.Contains(":\\"))//not absoloute
         fpath = BTZomBFingerFactory.DefaultSaveLocation + "\\" + urlPath;
     else
         fpath = urlPath;
 }
コード例 #3
0
 public SerialDataSource(ZomBUrl info)
 {
     int baud = 115200;
     int data = 8;
     Parity parity = Parity.None;
     StopBits stopbits = StopBits.One;
     if (info.Path.Length > 5 && info.Path[0] == '?')
     {
         var nv = HttpUtility.ParseQueryString(info.Path);
         if (nv["baud"] != null)
         {
             if (!int.TryParse(nv["baud"], out baud))
                 baud = 115200;
         }
         if (nv["data"] != null)
         {
             if (!int.TryParse(nv["data"], out data))
                 data = 8;
         }
         if (nv["parity"] != null)
         {
             try
             {
                 parity = (Parity)Enum.Parse(typeof(Parity), nv["parity"], true);
             }
             catch
             {
                 parity = Parity.None;
             }
         }
         if (nv["stop"] != null)
         {
             try
             {
                 stopbits = (StopBits)Enum.Parse(typeof(StopBits), nv["stop"], true);
             }
             catch
             {
                 stopbits = StopBits.One;
             }
         }
     }
     killer = new SerialPort("COM" + info.Port.ToString(), baud, parity, data, stopbits);
     killer.NewLine = "\n";
 }
コード例 #4
0
 public TCPDataSender(ZomBUrl zurl)
 {
     IPAddress = zurl.IPAddress;
     Port = zurl.Port;
 }
コード例 #5
0
 public TCPDataSource(ZomBUrl url)
 {
     IPAddress = url.IPAddress;
     Port = url.Port;
 }
コード例 #6
0
 internal DataPlayerSource(ZomBUrl url)
 {
     FilePath = url.Path.Substring(1);//remove first char
 }
コード例 #7
0
        public TestDataSource(ZomBUrl info)
        {

        }
コード例 #8
0
 public SmartDataSource(ZomBUrl info, IZomBController ddh)
 {
     if (ddh != null)
         this.ddh = ddh.GetDashboardDataHub();
 }