diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.Model/BR.cs b/BRServer.Model/BR.cs
deleted file mode 100644
index 3c71a94..0000000
--- a/BRServer.Model/BR.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BRServer.Model
-{
- public class BR
- {
- private long dbId;
- private string devCode;
- private DateTime logTime;
- private string cell;
- private float sedimentation;
- private DateTime upTime;
-
- public long DBID
- {
- get { return dbId; }
- set { dbId = value; }
- }
-
- public string DEVCODE
- {
- get { return devCode; }
- set { devCode = value; }
- }
-
- public DateTime LOGTIME
- {
- get { return logTime; }
- set { logTime = value; }
- }
-
- public string CELL
- {
- get { return cell; }
- set { cell = value; }
- }
-
- public float SEDIMENTATION
- {
- get { return sedimentation; }
- set { sedimentation = value; }
- }
-
- public DateTime UPTIME
- {
- get { return upTime; }
- set { upTime = value; }
- }
- }
-}
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.Model/BR.cs b/BRServer.Model/BR.cs
deleted file mode 100644
index 3c71a94..0000000
--- a/BRServer.Model/BR.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BRServer.Model
-{
- public class BR
- {
- private long dbId;
- private string devCode;
- private DateTime logTime;
- private string cell;
- private float sedimentation;
- private DateTime upTime;
-
- public long DBID
- {
- get { return dbId; }
- set { dbId = value; }
- }
-
- public string DEVCODE
- {
- get { return devCode; }
- set { devCode = value; }
- }
-
- public DateTime LOGTIME
- {
- get { return logTime; }
- set { logTime = value; }
- }
-
- public string CELL
- {
- get { return cell; }
- set { cell = value; }
- }
-
- public float SEDIMENTATION
- {
- get { return sedimentation; }
- set { sedimentation = value; }
- }
-
- public DateTime UPTIME
- {
- get { return upTime; }
- set { upTime = value; }
- }
- }
-}
diff --git a/BRServer/BRTagHandler.cs b/BRServer/BRTagHandler.cs
deleted file mode 100644
index 8428f7f..0000000
--- a/BRServer/BRTagHandler.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace BRServer
-{
- public class BRTagHandler:TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- if (!(tag is UploadTag))
- {
- return false;
- }
-
- UploadTag uploadTag = tag as UploadTag;
-
- return uploadTag.BizType == 18 ? true : false;//业务类型
- }
-
- public override void execute(Tag tag,String devCode,CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- //TODO LIST:解析数据,保存数据
- UploadTag BRTag = tag as UploadTag;
- int itv = BRTag.CollectInter;
- String collecTime = BRTag.CollectTime;
- int len = BRTag.Len;
- String dataValue = BRTag.DataValue;
-
- session.Logger.Info("北燃沉降监测仪数据上传TAG:oid:" + BRTag.Oid + " 采集间隔: " +
- itv + " 采集时间:" + collecTime + " 上传数值:" + dataValue);
-
- int num = len / 8;
- List djs = new List();
-
- DateTime baseTime = Convert.ToDateTime(systemDateTag.CollectDate + " " + collecTime);
- for (int i = 0; i < num; i++)
- {
- Model.BR BRInfo = new Model.BR();
- float sedimentation = strHexToSingle(dataValue.Substring(i * 8, 8));
-
- //TODO LIST:电池电量
- BRInfo.CELL = (cellTag == null ? "" : cellTag.Cell);
- BRInfo.SEDIMENTATION = sedimentation;
- BRInfo.LOGTIME = DateTime.Now;
- BRInfo.UPTIME = baseTime.AddMinutes(i * itv);
- BRInfo.DEVCODE = devCode;
- djs.Add(BRInfo);
- }
-
- BLL.BR.getInstance().insert(djs);
- session.Logger.Info("北燃沉降监测仪数据保存成功");
- }
-
- //网络序列转int
- private float strHexToSingle(String src)
- {
- if (src.Length != 8)
- return 0;
-
- byte[] lBt ={
- byte.Parse(src.Substring(0,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(2,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(4,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(6,2),System.Globalization.NumberStyles.HexNumber)
- };
- return BitConverter.ToSingle(lBt, 0);
- }
- }
-}
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.Model/BR.cs b/BRServer.Model/BR.cs
deleted file mode 100644
index 3c71a94..0000000
--- a/BRServer.Model/BR.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BRServer.Model
-{
- public class BR
- {
- private long dbId;
- private string devCode;
- private DateTime logTime;
- private string cell;
- private float sedimentation;
- private DateTime upTime;
-
- public long DBID
- {
- get { return dbId; }
- set { dbId = value; }
- }
-
- public string DEVCODE
- {
- get { return devCode; }
- set { devCode = value; }
- }
-
- public DateTime LOGTIME
- {
- get { return logTime; }
- set { logTime = value; }
- }
-
- public string CELL
- {
- get { return cell; }
- set { cell = value; }
- }
-
- public float SEDIMENTATION
- {
- get { return sedimentation; }
- set { sedimentation = value; }
- }
-
- public DateTime UPTIME
- {
- get { return upTime; }
- set { upTime = value; }
- }
- }
-}
diff --git a/BRServer/BRTagHandler.cs b/BRServer/BRTagHandler.cs
deleted file mode 100644
index 8428f7f..0000000
--- a/BRServer/BRTagHandler.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace BRServer
-{
- public class BRTagHandler:TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- if (!(tag is UploadTag))
- {
- return false;
- }
-
- UploadTag uploadTag = tag as UploadTag;
-
- return uploadTag.BizType == 18 ? true : false;//业务类型
- }
-
- public override void execute(Tag tag,String devCode,CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- //TODO LIST:解析数据,保存数据
- UploadTag BRTag = tag as UploadTag;
- int itv = BRTag.CollectInter;
- String collecTime = BRTag.CollectTime;
- int len = BRTag.Len;
- String dataValue = BRTag.DataValue;
-
- session.Logger.Info("北燃沉降监测仪数据上传TAG:oid:" + BRTag.Oid + " 采集间隔: " +
- itv + " 采集时间:" + collecTime + " 上传数值:" + dataValue);
-
- int num = len / 8;
- List djs = new List();
-
- DateTime baseTime = Convert.ToDateTime(systemDateTag.CollectDate + " " + collecTime);
- for (int i = 0; i < num; i++)
- {
- Model.BR BRInfo = new Model.BR();
- float sedimentation = strHexToSingle(dataValue.Substring(i * 8, 8));
-
- //TODO LIST:电池电量
- BRInfo.CELL = (cellTag == null ? "" : cellTag.Cell);
- BRInfo.SEDIMENTATION = sedimentation;
- BRInfo.LOGTIME = DateTime.Now;
- BRInfo.UPTIME = baseTime.AddMinutes(i * itv);
- BRInfo.DEVCODE = devCode;
- djs.Add(BRInfo);
- }
-
- BLL.BR.getInstance().insert(djs);
- session.Logger.Info("北燃沉降监测仪数据保存成功");
- }
-
- //网络序列转int
- private float strHexToSingle(String src)
- {
- if (src.Length != 8)
- return 0;
-
- byte[] lBt ={
- byte.Parse(src.Substring(0,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(2,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(4,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(6,2),System.Globalization.NumberStyles.HexNumber)
- };
- return BitConverter.ToSingle(lBt, 0);
- }
- }
-}
diff --git a/BRServer/CellTagHandler.cs b/BRServer/CellTagHandler.cs
deleted file mode 100644
index 156aeac..0000000
--- a/BRServer/CellTagHandler.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace BRServer
-{
- public class CellTagHandler : TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- return tag is CellTag ? true : false;
- }
-
- public override void execute(Tag tag, String devCode, CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- session.Logger.Info("电量TAG:oid:" + cellTag.Oid +
- " 电量:" + cellTag.Cell);
- }
-
- }
-}
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.Model/BR.cs b/BRServer.Model/BR.cs
deleted file mode 100644
index 3c71a94..0000000
--- a/BRServer.Model/BR.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BRServer.Model
-{
- public class BR
- {
- private long dbId;
- private string devCode;
- private DateTime logTime;
- private string cell;
- private float sedimentation;
- private DateTime upTime;
-
- public long DBID
- {
- get { return dbId; }
- set { dbId = value; }
- }
-
- public string DEVCODE
- {
- get { return devCode; }
- set { devCode = value; }
- }
-
- public DateTime LOGTIME
- {
- get { return logTime; }
- set { logTime = value; }
- }
-
- public string CELL
- {
- get { return cell; }
- set { cell = value; }
- }
-
- public float SEDIMENTATION
- {
- get { return sedimentation; }
- set { sedimentation = value; }
- }
-
- public DateTime UPTIME
- {
- get { return upTime; }
- set { upTime = value; }
- }
- }
-}
diff --git a/BRServer/BRTagHandler.cs b/BRServer/BRTagHandler.cs
deleted file mode 100644
index 8428f7f..0000000
--- a/BRServer/BRTagHandler.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace BRServer
-{
- public class BRTagHandler:TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- if (!(tag is UploadTag))
- {
- return false;
- }
-
- UploadTag uploadTag = tag as UploadTag;
-
- return uploadTag.BizType == 18 ? true : false;//业务类型
- }
-
- public override void execute(Tag tag,String devCode,CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- //TODO LIST:解析数据,保存数据
- UploadTag BRTag = tag as UploadTag;
- int itv = BRTag.CollectInter;
- String collecTime = BRTag.CollectTime;
- int len = BRTag.Len;
- String dataValue = BRTag.DataValue;
-
- session.Logger.Info("北燃沉降监测仪数据上传TAG:oid:" + BRTag.Oid + " 采集间隔: " +
- itv + " 采集时间:" + collecTime + " 上传数值:" + dataValue);
-
- int num = len / 8;
- List djs = new List();
-
- DateTime baseTime = Convert.ToDateTime(systemDateTag.CollectDate + " " + collecTime);
- for (int i = 0; i < num; i++)
- {
- Model.BR BRInfo = new Model.BR();
- float sedimentation = strHexToSingle(dataValue.Substring(i * 8, 8));
-
- //TODO LIST:电池电量
- BRInfo.CELL = (cellTag == null ? "" : cellTag.Cell);
- BRInfo.SEDIMENTATION = sedimentation;
- BRInfo.LOGTIME = DateTime.Now;
- BRInfo.UPTIME = baseTime.AddMinutes(i * itv);
- BRInfo.DEVCODE = devCode;
- djs.Add(BRInfo);
- }
-
- BLL.BR.getInstance().insert(djs);
- session.Logger.Info("北燃沉降监测仪数据保存成功");
- }
-
- //网络序列转int
- private float strHexToSingle(String src)
- {
- if (src.Length != 8)
- return 0;
-
- byte[] lBt ={
- byte.Parse(src.Substring(0,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(2,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(4,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(6,2),System.Globalization.NumberStyles.HexNumber)
- };
- return BitConverter.ToSingle(lBt, 0);
- }
- }
-}
diff --git a/BRServer/CellTagHandler.cs b/BRServer/CellTagHandler.cs
deleted file mode 100644
index 156aeac..0000000
--- a/BRServer/CellTagHandler.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace BRServer
-{
- public class CellTagHandler : TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- return tag is CellTag ? true : false;
- }
-
- public override void execute(Tag tag, String devCode, CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- session.Logger.Info("电量TAG:oid:" + cellTag.Oid +
- " 电量:" + cellTag.Cell);
- }
-
- }
-}
diff --git a/bin/BRCJServerTest.vshost.exe.config b/bin/BRCJServerTest.vshost.exe.config
deleted file mode 100644
index fe3c554..0000000
--- a/bin/BRCJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.Model/BR.cs b/BRServer.Model/BR.cs
deleted file mode 100644
index 3c71a94..0000000
--- a/BRServer.Model/BR.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BRServer.Model
-{
- public class BR
- {
- private long dbId;
- private string devCode;
- private DateTime logTime;
- private string cell;
- private float sedimentation;
- private DateTime upTime;
-
- public long DBID
- {
- get { return dbId; }
- set { dbId = value; }
- }
-
- public string DEVCODE
- {
- get { return devCode; }
- set { devCode = value; }
- }
-
- public DateTime LOGTIME
- {
- get { return logTime; }
- set { logTime = value; }
- }
-
- public string CELL
- {
- get { return cell; }
- set { cell = value; }
- }
-
- public float SEDIMENTATION
- {
- get { return sedimentation; }
- set { sedimentation = value; }
- }
-
- public DateTime UPTIME
- {
- get { return upTime; }
- set { upTime = value; }
- }
- }
-}
diff --git a/BRServer/BRTagHandler.cs b/BRServer/BRTagHandler.cs
deleted file mode 100644
index 8428f7f..0000000
--- a/BRServer/BRTagHandler.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace BRServer
-{
- public class BRTagHandler:TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- if (!(tag is UploadTag))
- {
- return false;
- }
-
- UploadTag uploadTag = tag as UploadTag;
-
- return uploadTag.BizType == 18 ? true : false;//业务类型
- }
-
- public override void execute(Tag tag,String devCode,CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- //TODO LIST:解析数据,保存数据
- UploadTag BRTag = tag as UploadTag;
- int itv = BRTag.CollectInter;
- String collecTime = BRTag.CollectTime;
- int len = BRTag.Len;
- String dataValue = BRTag.DataValue;
-
- session.Logger.Info("北燃沉降监测仪数据上传TAG:oid:" + BRTag.Oid + " 采集间隔: " +
- itv + " 采集时间:" + collecTime + " 上传数值:" + dataValue);
-
- int num = len / 8;
- List djs = new List();
-
- DateTime baseTime = Convert.ToDateTime(systemDateTag.CollectDate + " " + collecTime);
- for (int i = 0; i < num; i++)
- {
- Model.BR BRInfo = new Model.BR();
- float sedimentation = strHexToSingle(dataValue.Substring(i * 8, 8));
-
- //TODO LIST:电池电量
- BRInfo.CELL = (cellTag == null ? "" : cellTag.Cell);
- BRInfo.SEDIMENTATION = sedimentation;
- BRInfo.LOGTIME = DateTime.Now;
- BRInfo.UPTIME = baseTime.AddMinutes(i * itv);
- BRInfo.DEVCODE = devCode;
- djs.Add(BRInfo);
- }
-
- BLL.BR.getInstance().insert(djs);
- session.Logger.Info("北燃沉降监测仪数据保存成功");
- }
-
- //网络序列转int
- private float strHexToSingle(String src)
- {
- if (src.Length != 8)
- return 0;
-
- byte[] lBt ={
- byte.Parse(src.Substring(0,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(2,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(4,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(6,2),System.Globalization.NumberStyles.HexNumber)
- };
- return BitConverter.ToSingle(lBt, 0);
- }
- }
-}
diff --git a/BRServer/CellTagHandler.cs b/BRServer/CellTagHandler.cs
deleted file mode 100644
index 156aeac..0000000
--- a/BRServer/CellTagHandler.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace BRServer
-{
- public class CellTagHandler : TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- return tag is CellTag ? true : false;
- }
-
- public override void execute(Tag tag, String devCode, CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- session.Logger.Info("电量TAG:oid:" + cellTag.Oid +
- " 电量:" + cellTag.Cell);
- }
-
- }
-}
diff --git a/bin/BRCJServerTest.vshost.exe.config b/bin/BRCJServerTest.vshost.exe.config
deleted file mode 100644
index fe3c554..0000000
--- a/bin/BRCJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRCJServerTest.vshost.exe.manifest b/bin/BRCJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRCJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.Model/BR.cs b/BRServer.Model/BR.cs
deleted file mode 100644
index 3c71a94..0000000
--- a/BRServer.Model/BR.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BRServer.Model
-{
- public class BR
- {
- private long dbId;
- private string devCode;
- private DateTime logTime;
- private string cell;
- private float sedimentation;
- private DateTime upTime;
-
- public long DBID
- {
- get { return dbId; }
- set { dbId = value; }
- }
-
- public string DEVCODE
- {
- get { return devCode; }
- set { devCode = value; }
- }
-
- public DateTime LOGTIME
- {
- get { return logTime; }
- set { logTime = value; }
- }
-
- public string CELL
- {
- get { return cell; }
- set { cell = value; }
- }
-
- public float SEDIMENTATION
- {
- get { return sedimentation; }
- set { sedimentation = value; }
- }
-
- public DateTime UPTIME
- {
- get { return upTime; }
- set { upTime = value; }
- }
- }
-}
diff --git a/BRServer/BRTagHandler.cs b/BRServer/BRTagHandler.cs
deleted file mode 100644
index 8428f7f..0000000
--- a/BRServer/BRTagHandler.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace BRServer
-{
- public class BRTagHandler:TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- if (!(tag is UploadTag))
- {
- return false;
- }
-
- UploadTag uploadTag = tag as UploadTag;
-
- return uploadTag.BizType == 18 ? true : false;//业务类型
- }
-
- public override void execute(Tag tag,String devCode,CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- //TODO LIST:解析数据,保存数据
- UploadTag BRTag = tag as UploadTag;
- int itv = BRTag.CollectInter;
- String collecTime = BRTag.CollectTime;
- int len = BRTag.Len;
- String dataValue = BRTag.DataValue;
-
- session.Logger.Info("北燃沉降监测仪数据上传TAG:oid:" + BRTag.Oid + " 采集间隔: " +
- itv + " 采集时间:" + collecTime + " 上传数值:" + dataValue);
-
- int num = len / 8;
- List djs = new List();
-
- DateTime baseTime = Convert.ToDateTime(systemDateTag.CollectDate + " " + collecTime);
- for (int i = 0; i < num; i++)
- {
- Model.BR BRInfo = new Model.BR();
- float sedimentation = strHexToSingle(dataValue.Substring(i * 8, 8));
-
- //TODO LIST:电池电量
- BRInfo.CELL = (cellTag == null ? "" : cellTag.Cell);
- BRInfo.SEDIMENTATION = sedimentation;
- BRInfo.LOGTIME = DateTime.Now;
- BRInfo.UPTIME = baseTime.AddMinutes(i * itv);
- BRInfo.DEVCODE = devCode;
- djs.Add(BRInfo);
- }
-
- BLL.BR.getInstance().insert(djs);
- session.Logger.Info("北燃沉降监测仪数据保存成功");
- }
-
- //网络序列转int
- private float strHexToSingle(String src)
- {
- if (src.Length != 8)
- return 0;
-
- byte[] lBt ={
- byte.Parse(src.Substring(0,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(2,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(4,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(6,2),System.Globalization.NumberStyles.HexNumber)
- };
- return BitConverter.ToSingle(lBt, 0);
- }
- }
-}
diff --git a/BRServer/CellTagHandler.cs b/BRServer/CellTagHandler.cs
deleted file mode 100644
index 156aeac..0000000
--- a/BRServer/CellTagHandler.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace BRServer
-{
- public class CellTagHandler : TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- return tag is CellTag ? true : false;
- }
-
- public override void execute(Tag tag, String devCode, CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- session.Logger.Info("电量TAG:oid:" + cellTag.Oid +
- " 电量:" + cellTag.Cell);
- }
-
- }
-}
diff --git a/bin/BRCJServerTest.vshost.exe.config b/bin/BRCJServerTest.vshost.exe.config
deleted file mode 100644
index fe3c554..0000000
--- a/bin/BRCJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRCJServerTest.vshost.exe.manifest b/bin/BRCJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRCJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bin/BRKKJServerTest.vshost.exe.config b/bin/BRKKJServerTest.vshost.exe.config
deleted file mode 100644
index c65e387..0000000
--- a/bin/BRKKJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.Model/BR.cs b/BRServer.Model/BR.cs
deleted file mode 100644
index 3c71a94..0000000
--- a/BRServer.Model/BR.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BRServer.Model
-{
- public class BR
- {
- private long dbId;
- private string devCode;
- private DateTime logTime;
- private string cell;
- private float sedimentation;
- private DateTime upTime;
-
- public long DBID
- {
- get { return dbId; }
- set { dbId = value; }
- }
-
- public string DEVCODE
- {
- get { return devCode; }
- set { devCode = value; }
- }
-
- public DateTime LOGTIME
- {
- get { return logTime; }
- set { logTime = value; }
- }
-
- public string CELL
- {
- get { return cell; }
- set { cell = value; }
- }
-
- public float SEDIMENTATION
- {
- get { return sedimentation; }
- set { sedimentation = value; }
- }
-
- public DateTime UPTIME
- {
- get { return upTime; }
- set { upTime = value; }
- }
- }
-}
diff --git a/BRServer/BRTagHandler.cs b/BRServer/BRTagHandler.cs
deleted file mode 100644
index 8428f7f..0000000
--- a/BRServer/BRTagHandler.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace BRServer
-{
- public class BRTagHandler:TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- if (!(tag is UploadTag))
- {
- return false;
- }
-
- UploadTag uploadTag = tag as UploadTag;
-
- return uploadTag.BizType == 18 ? true : false;//业务类型
- }
-
- public override void execute(Tag tag,String devCode,CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- //TODO LIST:解析数据,保存数据
- UploadTag BRTag = tag as UploadTag;
- int itv = BRTag.CollectInter;
- String collecTime = BRTag.CollectTime;
- int len = BRTag.Len;
- String dataValue = BRTag.DataValue;
-
- session.Logger.Info("北燃沉降监测仪数据上传TAG:oid:" + BRTag.Oid + " 采集间隔: " +
- itv + " 采集时间:" + collecTime + " 上传数值:" + dataValue);
-
- int num = len / 8;
- List djs = new List();
-
- DateTime baseTime = Convert.ToDateTime(systemDateTag.CollectDate + " " + collecTime);
- for (int i = 0; i < num; i++)
- {
- Model.BR BRInfo = new Model.BR();
- float sedimentation = strHexToSingle(dataValue.Substring(i * 8, 8));
-
- //TODO LIST:电池电量
- BRInfo.CELL = (cellTag == null ? "" : cellTag.Cell);
- BRInfo.SEDIMENTATION = sedimentation;
- BRInfo.LOGTIME = DateTime.Now;
- BRInfo.UPTIME = baseTime.AddMinutes(i * itv);
- BRInfo.DEVCODE = devCode;
- djs.Add(BRInfo);
- }
-
- BLL.BR.getInstance().insert(djs);
- session.Logger.Info("北燃沉降监测仪数据保存成功");
- }
-
- //网络序列转int
- private float strHexToSingle(String src)
- {
- if (src.Length != 8)
- return 0;
-
- byte[] lBt ={
- byte.Parse(src.Substring(0,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(2,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(4,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(6,2),System.Globalization.NumberStyles.HexNumber)
- };
- return BitConverter.ToSingle(lBt, 0);
- }
- }
-}
diff --git a/BRServer/CellTagHandler.cs b/BRServer/CellTagHandler.cs
deleted file mode 100644
index 156aeac..0000000
--- a/BRServer/CellTagHandler.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace BRServer
-{
- public class CellTagHandler : TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- return tag is CellTag ? true : false;
- }
-
- public override void execute(Tag tag, String devCode, CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- session.Logger.Info("电量TAG:oid:" + cellTag.Oid +
- " 电量:" + cellTag.Cell);
- }
-
- }
-}
diff --git a/bin/BRCJServerTest.vshost.exe.config b/bin/BRCJServerTest.vshost.exe.config
deleted file mode 100644
index fe3c554..0000000
--- a/bin/BRCJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRCJServerTest.vshost.exe.manifest b/bin/BRCJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRCJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bin/BRKKJServerTest.vshost.exe.config b/bin/BRKKJServerTest.vshost.exe.config
deleted file mode 100644
index c65e387..0000000
--- a/bin/BRKKJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRKKJServerTest.vshost.exe.manifest b/bin/BRKKJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRKKJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.Model/BR.cs b/BRServer.Model/BR.cs
deleted file mode 100644
index 3c71a94..0000000
--- a/BRServer.Model/BR.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BRServer.Model
-{
- public class BR
- {
- private long dbId;
- private string devCode;
- private DateTime logTime;
- private string cell;
- private float sedimentation;
- private DateTime upTime;
-
- public long DBID
- {
- get { return dbId; }
- set { dbId = value; }
- }
-
- public string DEVCODE
- {
- get { return devCode; }
- set { devCode = value; }
- }
-
- public DateTime LOGTIME
- {
- get { return logTime; }
- set { logTime = value; }
- }
-
- public string CELL
- {
- get { return cell; }
- set { cell = value; }
- }
-
- public float SEDIMENTATION
- {
- get { return sedimentation; }
- set { sedimentation = value; }
- }
-
- public DateTime UPTIME
- {
- get { return upTime; }
- set { upTime = value; }
- }
- }
-}
diff --git a/BRServer/BRTagHandler.cs b/BRServer/BRTagHandler.cs
deleted file mode 100644
index 8428f7f..0000000
--- a/BRServer/BRTagHandler.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace BRServer
-{
- public class BRTagHandler:TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- if (!(tag is UploadTag))
- {
- return false;
- }
-
- UploadTag uploadTag = tag as UploadTag;
-
- return uploadTag.BizType == 18 ? true : false;//业务类型
- }
-
- public override void execute(Tag tag,String devCode,CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- //TODO LIST:解析数据,保存数据
- UploadTag BRTag = tag as UploadTag;
- int itv = BRTag.CollectInter;
- String collecTime = BRTag.CollectTime;
- int len = BRTag.Len;
- String dataValue = BRTag.DataValue;
-
- session.Logger.Info("北燃沉降监测仪数据上传TAG:oid:" + BRTag.Oid + " 采集间隔: " +
- itv + " 采集时间:" + collecTime + " 上传数值:" + dataValue);
-
- int num = len / 8;
- List djs = new List();
-
- DateTime baseTime = Convert.ToDateTime(systemDateTag.CollectDate + " " + collecTime);
- for (int i = 0; i < num; i++)
- {
- Model.BR BRInfo = new Model.BR();
- float sedimentation = strHexToSingle(dataValue.Substring(i * 8, 8));
-
- //TODO LIST:电池电量
- BRInfo.CELL = (cellTag == null ? "" : cellTag.Cell);
- BRInfo.SEDIMENTATION = sedimentation;
- BRInfo.LOGTIME = DateTime.Now;
- BRInfo.UPTIME = baseTime.AddMinutes(i * itv);
- BRInfo.DEVCODE = devCode;
- djs.Add(BRInfo);
- }
-
- BLL.BR.getInstance().insert(djs);
- session.Logger.Info("北燃沉降监测仪数据保存成功");
- }
-
- //网络序列转int
- private float strHexToSingle(String src)
- {
- if (src.Length != 8)
- return 0;
-
- byte[] lBt ={
- byte.Parse(src.Substring(0,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(2,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(4,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(6,2),System.Globalization.NumberStyles.HexNumber)
- };
- return BitConverter.ToSingle(lBt, 0);
- }
- }
-}
diff --git a/BRServer/CellTagHandler.cs b/BRServer/CellTagHandler.cs
deleted file mode 100644
index 156aeac..0000000
--- a/BRServer/CellTagHandler.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace BRServer
-{
- public class CellTagHandler : TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- return tag is CellTag ? true : false;
- }
-
- public override void execute(Tag tag, String devCode, CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- session.Logger.Info("电量TAG:oid:" + cellTag.Oid +
- " 电量:" + cellTag.Cell);
- }
-
- }
-}
diff --git a/bin/BRCJServerTest.vshost.exe.config b/bin/BRCJServerTest.vshost.exe.config
deleted file mode 100644
index fe3c554..0000000
--- a/bin/BRCJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRCJServerTest.vshost.exe.manifest b/bin/BRCJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRCJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bin/BRKKJServerTest.vshost.exe.config b/bin/BRKKJServerTest.vshost.exe.config
deleted file mode 100644
index c65e387..0000000
--- a/bin/BRKKJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRKKJServerTest.vshost.exe.manifest b/bin/BRKKJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRKKJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bin/Logs/debug.log20190311 b/bin/Logs/debug.log20190311
deleted file mode 100644
index 4065b04..0000000
--- a/bin/Logs/debug.log20190311
+++ /dev/null
@@ -1,34 +0,0 @@
-2019-03-11 16:55:14,372 [5156] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 16:55:14,413 [5156] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 16:55:14,425 [5156] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 16:55:16,968 [5156] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 16:55:16,968 [5156] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 16:55:17,000 [5156] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 16:56:28,539 [2036] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 16:56:28,593 [2036] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 16:56:28,605 [2036] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 16:56:31,112 [2036] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 16:56:31,112 [2036] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 16:56:31,141 [2036] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 16:56:31,146 [2036] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 17:28:54,258 [7856] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 17:28:54,297 [7856] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 17:28:54,309 [7856] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 17:28:56,960 [7856] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 17:28:56,960 [7856] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 17:28:56,994 [7856] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 17:28:56,999 [7856] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 17:32:25,419 [9056] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 17:32:25,456 [9056] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 17:32:25,469 [9056] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 17:32:28,049 [9056] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 17:32:28,049 [9056] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 17:32:28,088 [9056] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 17:32:28,092 [9056] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 18:02:05,789 [2420] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 18:02:05,826 [2420] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 18:02:05,838 [2420] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 18:02:08,435 [2420] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 18:02:08,435 [2420] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 18:02:08,474 [2420] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 18:02:08,479 [2420] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.Model/BR.cs b/BRServer.Model/BR.cs
deleted file mode 100644
index 3c71a94..0000000
--- a/BRServer.Model/BR.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BRServer.Model
-{
- public class BR
- {
- private long dbId;
- private string devCode;
- private DateTime logTime;
- private string cell;
- private float sedimentation;
- private DateTime upTime;
-
- public long DBID
- {
- get { return dbId; }
- set { dbId = value; }
- }
-
- public string DEVCODE
- {
- get { return devCode; }
- set { devCode = value; }
- }
-
- public DateTime LOGTIME
- {
- get { return logTime; }
- set { logTime = value; }
- }
-
- public string CELL
- {
- get { return cell; }
- set { cell = value; }
- }
-
- public float SEDIMENTATION
- {
- get { return sedimentation; }
- set { sedimentation = value; }
- }
-
- public DateTime UPTIME
- {
- get { return upTime; }
- set { upTime = value; }
- }
- }
-}
diff --git a/BRServer/BRTagHandler.cs b/BRServer/BRTagHandler.cs
deleted file mode 100644
index 8428f7f..0000000
--- a/BRServer/BRTagHandler.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace BRServer
-{
- public class BRTagHandler:TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- if (!(tag is UploadTag))
- {
- return false;
- }
-
- UploadTag uploadTag = tag as UploadTag;
-
- return uploadTag.BizType == 18 ? true : false;//业务类型
- }
-
- public override void execute(Tag tag,String devCode,CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- //TODO LIST:解析数据,保存数据
- UploadTag BRTag = tag as UploadTag;
- int itv = BRTag.CollectInter;
- String collecTime = BRTag.CollectTime;
- int len = BRTag.Len;
- String dataValue = BRTag.DataValue;
-
- session.Logger.Info("北燃沉降监测仪数据上传TAG:oid:" + BRTag.Oid + " 采集间隔: " +
- itv + " 采集时间:" + collecTime + " 上传数值:" + dataValue);
-
- int num = len / 8;
- List djs = new List();
-
- DateTime baseTime = Convert.ToDateTime(systemDateTag.CollectDate + " " + collecTime);
- for (int i = 0; i < num; i++)
- {
- Model.BR BRInfo = new Model.BR();
- float sedimentation = strHexToSingle(dataValue.Substring(i * 8, 8));
-
- //TODO LIST:电池电量
- BRInfo.CELL = (cellTag == null ? "" : cellTag.Cell);
- BRInfo.SEDIMENTATION = sedimentation;
- BRInfo.LOGTIME = DateTime.Now;
- BRInfo.UPTIME = baseTime.AddMinutes(i * itv);
- BRInfo.DEVCODE = devCode;
- djs.Add(BRInfo);
- }
-
- BLL.BR.getInstance().insert(djs);
- session.Logger.Info("北燃沉降监测仪数据保存成功");
- }
-
- //网络序列转int
- private float strHexToSingle(String src)
- {
- if (src.Length != 8)
- return 0;
-
- byte[] lBt ={
- byte.Parse(src.Substring(0,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(2,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(4,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(6,2),System.Globalization.NumberStyles.HexNumber)
- };
- return BitConverter.ToSingle(lBt, 0);
- }
- }
-}
diff --git a/BRServer/CellTagHandler.cs b/BRServer/CellTagHandler.cs
deleted file mode 100644
index 156aeac..0000000
--- a/BRServer/CellTagHandler.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace BRServer
-{
- public class CellTagHandler : TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- return tag is CellTag ? true : false;
- }
-
- public override void execute(Tag tag, String devCode, CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- session.Logger.Info("电量TAG:oid:" + cellTag.Oid +
- " 电量:" + cellTag.Cell);
- }
-
- }
-}
diff --git a/bin/BRCJServerTest.vshost.exe.config b/bin/BRCJServerTest.vshost.exe.config
deleted file mode 100644
index fe3c554..0000000
--- a/bin/BRCJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRCJServerTest.vshost.exe.manifest b/bin/BRCJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRCJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bin/BRKKJServerTest.vshost.exe.config b/bin/BRKKJServerTest.vshost.exe.config
deleted file mode 100644
index c65e387..0000000
--- a/bin/BRKKJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRKKJServerTest.vshost.exe.manifest b/bin/BRKKJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRKKJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bin/Logs/debug.log20190311 b/bin/Logs/debug.log20190311
deleted file mode 100644
index 4065b04..0000000
--- a/bin/Logs/debug.log20190311
+++ /dev/null
@@ -1,34 +0,0 @@
-2019-03-11 16:55:14,372 [5156] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 16:55:14,413 [5156] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 16:55:14,425 [5156] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 16:55:16,968 [5156] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 16:55:16,968 [5156] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 16:55:17,000 [5156] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 16:56:28,539 [2036] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 16:56:28,593 [2036] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 16:56:28,605 [2036] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 16:56:31,112 [2036] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 16:56:31,112 [2036] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 16:56:31,141 [2036] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 16:56:31,146 [2036] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 17:28:54,258 [7856] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 17:28:54,297 [7856] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 17:28:54,309 [7856] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 17:28:56,960 [7856] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 17:28:56,960 [7856] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 17:28:56,994 [7856] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 17:28:56,999 [7856] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 17:32:25,419 [9056] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 17:32:25,456 [9056] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 17:32:25,469 [9056] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 17:32:28,049 [9056] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 17:32:28,049 [9056] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 17:32:28,088 [9056] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 17:32:28,092 [9056] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 18:02:05,789 [2420] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 18:02:05,826 [2420] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 18:02:05,838 [2420] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 18:02:08,435 [2420] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 18:02:08,435 [2420] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 18:02:08,474 [2420] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 18:02:08,479 [2420] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
diff --git a/bin/Logs/err.log20190311 b/bin/Logs/err.log20190311
deleted file mode 100644
index d037cfc..0000000
--- a/bin/Logs/err.log20190311
+++ /dev/null
@@ -1,42 +0,0 @@
-2019-03-11 16:52:50,558 [3160] ERROR DefaultBootstrap - Failed to create server instance TelecomServer!
-System.IO.FileNotFoundException: δ�ܼ����ļ������BRKKJServer��������ijһ�������ϵͳ�Ҳ���ָ�����ļ���
-���:��BRKKJServer��
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
- �� System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
- �� System.Type.GetType(String typeName, Boolean throwOnError)
- �� SuperSocket.SocketEngine.DefaultBootstrap.CreateWorkItemInstance(String serviceTypeName, StatusInfoAttribute[] serverStatusMetadata)
- �� SuperSocket.SocketEngine.DefaultBootstrap.InitializeAndSetupWorkItem(WorkItemFactoryInfo factoryInfo)
-
-=== Ԥ��״̬��Ϣ ===
-��־: DisplayName = BRKKJServer
- (Partial)
-����: Ϊ�����ṩ�˲��ְ���Ϣ:
-����: ��������: BRKKJServer | �� ID: 1
-����: �����ṩ������ʾ���Ƶ�һ����ʱ�����������ְ�
-����: ����ܵ������������ش���ij���
-����: ����Ϊ�����ṩ��ȫָ�������ֱ�ʶ��
-����: ���ɼ����ơ��汾�������Ժ�Կ�����ɡ�
-����: �йش��������ϸ��Ϣ�ͳ��������������μ���Ƥ�� http://go.microsoft.com/fwlink/?LinkId=109270��
-��־: Appbase = file:///E:/gwq/BRCJServer/bin/
-��־: ��ʼ PrivatePath = NULL
-����: SuperSocket.SocketEngine, Version=1.6.2.0, Culture=neutral, PublicKeyToken=6c80000676988ebb��
-===
-��־: �˰� default ���������Ŀ�ʼ��
-��־: ����ʹ��Ӧ�ó��������ļ�: E:\gwq\BRCJServer\bin\BRCJServerTest.vshost.exe.config
-��־: ʹ�����������ļ�:
-��־: ʹ�� C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config �ļ���������ļ���
-��־: ��ʱû��Ϊ����Ӧ�ò���(˽�С��Զ��塢�ֲ������λ�õij���)��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer.DLL��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer/BRKKJServer.DLL��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer.EXE��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer/BRKKJServer.EXE��
-
-2019-03-11 16:53:58,108 [6852] ERROR DefaultBootstrap - Failed to create server instance TelecomServer!
-System.TypeLoadException: δ�ܴӳ���BRCJServer���м������͡�BRCJServer.TelecomServer����
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
- �� System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
- �� System.Type.GetType(String typeName, Boolean throwOnError)
- �� SuperSocket.SocketEngine.DefaultBootstrap.CreateWorkItemInstance(String serviceTypeName, StatusInfoAttribute[] serverStatusMetadata)
- �� SuperSocket.SocketEngine.DefaultBootstrap.InitializeAndSetupWorkItem(WorkItemFactoryInfo factoryInfo)
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.Model/BR.cs b/BRServer.Model/BR.cs
deleted file mode 100644
index 3c71a94..0000000
--- a/BRServer.Model/BR.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BRServer.Model
-{
- public class BR
- {
- private long dbId;
- private string devCode;
- private DateTime logTime;
- private string cell;
- private float sedimentation;
- private DateTime upTime;
-
- public long DBID
- {
- get { return dbId; }
- set { dbId = value; }
- }
-
- public string DEVCODE
- {
- get { return devCode; }
- set { devCode = value; }
- }
-
- public DateTime LOGTIME
- {
- get { return logTime; }
- set { logTime = value; }
- }
-
- public string CELL
- {
- get { return cell; }
- set { cell = value; }
- }
-
- public float SEDIMENTATION
- {
- get { return sedimentation; }
- set { sedimentation = value; }
- }
-
- public DateTime UPTIME
- {
- get { return upTime; }
- set { upTime = value; }
- }
- }
-}
diff --git a/BRServer/BRTagHandler.cs b/BRServer/BRTagHandler.cs
deleted file mode 100644
index 8428f7f..0000000
--- a/BRServer/BRTagHandler.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace BRServer
-{
- public class BRTagHandler:TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- if (!(tag is UploadTag))
- {
- return false;
- }
-
- UploadTag uploadTag = tag as UploadTag;
-
- return uploadTag.BizType == 18 ? true : false;//业务类型
- }
-
- public override void execute(Tag tag,String devCode,CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- //TODO LIST:解析数据,保存数据
- UploadTag BRTag = tag as UploadTag;
- int itv = BRTag.CollectInter;
- String collecTime = BRTag.CollectTime;
- int len = BRTag.Len;
- String dataValue = BRTag.DataValue;
-
- session.Logger.Info("北燃沉降监测仪数据上传TAG:oid:" + BRTag.Oid + " 采集间隔: " +
- itv + " 采集时间:" + collecTime + " 上传数值:" + dataValue);
-
- int num = len / 8;
- List djs = new List();
-
- DateTime baseTime = Convert.ToDateTime(systemDateTag.CollectDate + " " + collecTime);
- for (int i = 0; i < num; i++)
- {
- Model.BR BRInfo = new Model.BR();
- float sedimentation = strHexToSingle(dataValue.Substring(i * 8, 8));
-
- //TODO LIST:电池电量
- BRInfo.CELL = (cellTag == null ? "" : cellTag.Cell);
- BRInfo.SEDIMENTATION = sedimentation;
- BRInfo.LOGTIME = DateTime.Now;
- BRInfo.UPTIME = baseTime.AddMinutes(i * itv);
- BRInfo.DEVCODE = devCode;
- djs.Add(BRInfo);
- }
-
- BLL.BR.getInstance().insert(djs);
- session.Logger.Info("北燃沉降监测仪数据保存成功");
- }
-
- //网络序列转int
- private float strHexToSingle(String src)
- {
- if (src.Length != 8)
- return 0;
-
- byte[] lBt ={
- byte.Parse(src.Substring(0,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(2,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(4,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(6,2),System.Globalization.NumberStyles.HexNumber)
- };
- return BitConverter.ToSingle(lBt, 0);
- }
- }
-}
diff --git a/BRServer/CellTagHandler.cs b/BRServer/CellTagHandler.cs
deleted file mode 100644
index 156aeac..0000000
--- a/BRServer/CellTagHandler.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace BRServer
-{
- public class CellTagHandler : TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- return tag is CellTag ? true : false;
- }
-
- public override void execute(Tag tag, String devCode, CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- session.Logger.Info("电量TAG:oid:" + cellTag.Oid +
- " 电量:" + cellTag.Cell);
- }
-
- }
-}
diff --git a/bin/BRCJServerTest.vshost.exe.config b/bin/BRCJServerTest.vshost.exe.config
deleted file mode 100644
index fe3c554..0000000
--- a/bin/BRCJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRCJServerTest.vshost.exe.manifest b/bin/BRCJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRCJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bin/BRKKJServerTest.vshost.exe.config b/bin/BRKKJServerTest.vshost.exe.config
deleted file mode 100644
index c65e387..0000000
--- a/bin/BRKKJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRKKJServerTest.vshost.exe.manifest b/bin/BRKKJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRKKJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bin/Logs/debug.log20190311 b/bin/Logs/debug.log20190311
deleted file mode 100644
index 4065b04..0000000
--- a/bin/Logs/debug.log20190311
+++ /dev/null
@@ -1,34 +0,0 @@
-2019-03-11 16:55:14,372 [5156] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 16:55:14,413 [5156] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 16:55:14,425 [5156] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 16:55:16,968 [5156] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 16:55:16,968 [5156] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 16:55:17,000 [5156] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 16:56:28,539 [2036] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 16:56:28,593 [2036] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 16:56:28,605 [2036] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 16:56:31,112 [2036] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 16:56:31,112 [2036] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 16:56:31,141 [2036] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 16:56:31,146 [2036] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 17:28:54,258 [7856] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 17:28:54,297 [7856] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 17:28:54,309 [7856] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 17:28:56,960 [7856] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 17:28:56,960 [7856] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 17:28:56,994 [7856] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 17:28:56,999 [7856] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 17:32:25,419 [9056] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 17:32:25,456 [9056] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 17:32:25,469 [9056] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 17:32:28,049 [9056] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 17:32:28,049 [9056] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 17:32:28,088 [9056] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 17:32:28,092 [9056] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 18:02:05,789 [2420] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 18:02:05,826 [2420] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 18:02:05,838 [2420] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 18:02:08,435 [2420] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 18:02:08,435 [2420] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 18:02:08,474 [2420] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 18:02:08,479 [2420] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
diff --git a/bin/Logs/err.log20190311 b/bin/Logs/err.log20190311
deleted file mode 100644
index d037cfc..0000000
--- a/bin/Logs/err.log20190311
+++ /dev/null
@@ -1,42 +0,0 @@
-2019-03-11 16:52:50,558 [3160] ERROR DefaultBootstrap - Failed to create server instance TelecomServer!
-System.IO.FileNotFoundException: δ�ܼ����ļ������BRKKJServer��������ijһ�������ϵͳ�Ҳ���ָ�����ļ���
-���:��BRKKJServer��
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
- �� System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
- �� System.Type.GetType(String typeName, Boolean throwOnError)
- �� SuperSocket.SocketEngine.DefaultBootstrap.CreateWorkItemInstance(String serviceTypeName, StatusInfoAttribute[] serverStatusMetadata)
- �� SuperSocket.SocketEngine.DefaultBootstrap.InitializeAndSetupWorkItem(WorkItemFactoryInfo factoryInfo)
-
-=== Ԥ��״̬��Ϣ ===
-��־: DisplayName = BRKKJServer
- (Partial)
-����: Ϊ�����ṩ�˲��ְ���Ϣ:
-����: ��������: BRKKJServer | �� ID: 1
-����: �����ṩ������ʾ���Ƶ�һ����ʱ�����������ְ�
-����: ����ܵ������������ش���ij���
-����: ����Ϊ�����ṩ��ȫָ�������ֱ�ʶ��
-����: ���ɼ����ơ��汾�������Ժ�Կ�����ɡ�
-����: �йش��������ϸ��Ϣ�ͳ��������������μ���Ƥ�� http://go.microsoft.com/fwlink/?LinkId=109270��
-��־: Appbase = file:///E:/gwq/BRCJServer/bin/
-��־: ��ʼ PrivatePath = NULL
-����: SuperSocket.SocketEngine, Version=1.6.2.0, Culture=neutral, PublicKeyToken=6c80000676988ebb��
-===
-��־: �˰� default ���������Ŀ�ʼ��
-��־: ����ʹ��Ӧ�ó��������ļ�: E:\gwq\BRCJServer\bin\BRCJServerTest.vshost.exe.config
-��־: ʹ�����������ļ�:
-��־: ʹ�� C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config �ļ���������ļ���
-��־: ��ʱû��Ϊ����Ӧ�ò���(˽�С��Զ��塢�ֲ������λ�õij���)��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer.DLL��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer/BRKKJServer.DLL��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer.EXE��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer/BRKKJServer.EXE��
-
-2019-03-11 16:53:58,108 [6852] ERROR DefaultBootstrap - Failed to create server instance TelecomServer!
-System.TypeLoadException: δ�ܴӳ���BRCJServer���м������͡�BRCJServer.TelecomServer����
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
- �� System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
- �� System.Type.GetType(String typeName, Boolean throwOnError)
- �� SuperSocket.SocketEngine.DefaultBootstrap.CreateWorkItemInstance(String serviceTypeName, StatusInfoAttribute[] serverStatusMetadata)
- �� SuperSocket.SocketEngine.DefaultBootstrap.InitializeAndSetupWorkItem(WorkItemFactoryInfo factoryInfo)
diff --git a/bin/Logs/info.log20190311 b/bin/Logs/info.log20190311
deleted file mode 100644
index 57ba5f6..0000000
--- a/bin/Logs/info.log20190311
+++ /dev/null
@@ -1,4 +0,0 @@
-2019-03-11 16:56:31,142 [2036] INFO TelecomServer - The server instance TelecomServer has been started!
-2019-03-11 17:28:56,994 [7856] INFO TelecomServer - The server instance TelecomServer has been started!
-2019-03-11 17:32:28,088 [9056] INFO TelecomServer - The server instance TelecomServer has been started!
-2019-03-11 18:02:08,475 [2420] INFO TelecomServer - The server instance TelecomServer has been started!
diff --git a/BRServer.BLL/BR.cs b/BRServer.BLL/BR.cs
deleted file mode 100644
index 918913b..0000000
--- a/BRServer.BLL/BR.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using BRServer.IDAL;
-
-namespace BRServer.BLL
-{
- public class BR
- {
- private static BR br;
-
- private BR()
- {
- }
-
- public static BR getInstance()
- {
- if (br == null)
- {
- br = new BR();
- }
- return br;
- }
-
- ///
- /// A method to insert a new Adapter
- ///
- /// An adapter entity with information about the new adapter
- public void insert(List djs)
- {
- if (djs.Count <= 0)
- {
- return;
- }
-
- IBR dal = DALFactory.BR.Create();
- dal.insert(djs);
-
-
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- IBR dal = DALFactory.BR.Create();
- dal.updateSequence(sequeceName);
- }
-
- }
-}
diff --git a/BRServer.DAL/BR.cs b/BRServer.DAL/BR.cs
deleted file mode 100644
index 5b6742b..0000000
--- a/BRServer.DAL/BR.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using MySql.Data.MySqlClient;
-
-namespace BRServer.DAL
-{
- public class BR : IDAL.IBR
- {
- public static readonly string ConnectionStringOrderDistributedTransaction =
- System.Configuration.ConfigurationManager.AppSettings["MySqlConnString"];
-
- // Static constants
- private const string TABLE_NAME = "BRKKJ_DATA";
-
- private const string COLUMN_DEVCODE = "DEVCODE";
- private const string COLUMN_LOGTIME = "LOGTIME";
- private const string COLUMN_CELL = "CELL";
- private const string COLUMN_SEDIMENTATION = "SEDIMENTATION";
- private const string COLUMN_UPTIME = "UPTIME";
-
- private const string PARM_DEVCODE = "@DEVCODE";
- private const string PARM_LOGTIME = "@LOGTIME";
- private const string PARM_CELL = "@CELL";
- private const string PARM_SEDIMENTATION = "@SEDIMENTATION";
- private const string PARM_UPTIME = "@UPTIME";
-
- private const string SQL_INSERT_CJ = "INSERT INTO " + TABLE_NAME
- + " (" + COLUMN_DEVCODE + ","
- + " " + COLUMN_LOGTIME + ","
- + " " + COLUMN_CELL + ","
- + " " + COLUMN_SEDIMENTATION + ","
- + " " + COLUMN_UPTIME + ")"
- + " VALUES "
- + " (" + PARM_DEVCODE + ","
- + " " + PARM_LOGTIME + ","
- + " " + PARM_CELL + ","
- + " " + PARM_SEDIMENTATION + ","
- + " " + PARM_UPTIME + ")";
-
-
- public void insert(List cjs)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- foreach (Model.BR cj in cjs)
- {
- if (string.IsNullOrEmpty(cj.DEVCODE))
- {
- throw new Exception("设备ID为空!");
- }
-
- MySqlParameter[] parms = GetAdapterParameters();
- SetAdapterParameters(parms, cj);
-
- MySqlCommand cmd = new MySqlCommand(SQL_INSERT_CJ, conn);
- foreach (MySqlParameter pram in parms)
- cmd.Parameters.Add(pram);
- cmd.ExecuteNonQuery();
- }
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
- /**
- *sequeceName:需要更新的序列名称
- *key:主键字段名称
- *tableName:表名称
- */
- public void updateSequence(String sequeceName)
- {
- MySqlTransaction tran = null;
- using (MySqlConnection conn = new MySqlConnection(ConnectionStringOrderDistributedTransaction))
- {
- try
- {
- conn.Open();
- tran = conn.BeginTransaction();
-
- String SQL_DROP_SEQUENCE = "ALTER TABLE " + TABLE_NAME +" DROP "+ sequeceName;
- MySqlCommand cmd1 = new MySqlCommand(SQL_DROP_SEQUENCE, conn);
- cmd1.ExecuteNonQuery();
-
- String SQL_ADD_SEQUENC = "ALTER TABLE " + TABLE_NAME + " ADD " + sequeceName +
- " INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (" + sequeceName + ")";
-
- MySqlCommand cmd2 = new MySqlCommand(SQL_ADD_SEQUENC, conn);
- cmd2.ExecuteNonQuery();
-
- tran.Commit();
- }
- catch (Exception e)
- {
- if (null != tran)
- {
- tran.Rollback();
- }
- throw (e);
- }
- }
- }
-
-
-
-
- ///
- /// An internal function to get the database parameters
- ///
- /// Parameter array
- private static MySqlParameter[] GetAdapterParameters()
- {
- MySqlParameter[] parms = null;//OracleHelperParameterCache.GetCachedParameterSet(SQL_INSERT_WS, "INSERT:UPDATE");
-
- if (parms == null)
- {
- parms = new MySqlParameter[]{
- new MySqlParameter(PARM_DEVCODE, MySqlDbType.VarChar, 255),
- new MySqlParameter(PARM_LOGTIME, MySqlDbType.DateTime),
- new MySqlParameter(PARM_CELL, MySqlDbType.VarChar,255),
- new MySqlParameter(PARM_SEDIMENTATION, MySqlDbType.Float,20),
- new MySqlParameter(PARM_UPTIME, MySqlDbType.DateTime)
- };
- }
-
- return parms;
- }
-
-
- ///
- /// An internal function to bind values parameters for insert
- ///
- /// Database parameters
- /// Values to bind to parameters
- private void SetAdapterParameters(MySqlParameter[] parms, Model.BR cj)
- {
- parms[0].Value = cj.DEVCODE;
-
- if (null != cj.LOGTIME)
- {
- parms[1].Value = cj.LOGTIME;
- }
- else
- {
- parms[1].Value = DBNull.Value;
- }
-
- if (null != cj.CELL)
- {
- parms[2].Value = cj.CELL;
- }
- else
- {
- parms[2].Value = DBNull.Value;
- }
-
- if (null != cj.SEDIMENTATION)
- {
- parms[3].Value = cj.SEDIMENTATION;
- }
- else
- {
- parms[3].Value = DBNull.Value;
- }
-
- if (null != cj.UPTIME)
- {
- parms[4].Value = cj.UPTIME;
- }
- else
- {
- parms[4].Value = DBNull.Value;
- }
- }
- }
-}
diff --git a/BRServer.DALFactory/BR.cs b/BRServer.DALFactory/BR.cs
deleted file mode 100644
index bd41c0f..0000000
--- a/BRServer.DALFactory/BR.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Reflection;
-
-namespace BRServer.DALFactory
-{
- public class BR
- {
- public static BRServer.IDAL.IBR Create()
- {
- // Look up the DAL implementation we should be using
- string path = System.Configuration.ConfigurationManager.AppSettings["mysqlDAL"];
- string className = path + ".BR";
-
- // Using the evidence given in the config file load the appropriate assembly and class
- return (BRServer.IDAL.IBR)Assembly.Load(path).CreateInstance(className);
- }
- }
-}
diff --git a/BRServer.IDAL/IBR.cs b/BRServer.IDAL/IBR.cs
deleted file mode 100644
index 6a36b3f..0000000
--- a/BRServer.IDAL/IBR.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace BRServer.IDAL
-{
- public interface IBR
- {
- void insert(List djs);
- void updateSequence(String sequeceName);
- //int queryCountByDevAndUpTime(String devCode, DateTime upTime);
-
- //float getLastData(Model.BRKKJ tempInfo);
- }
-}
diff --git a/BRServer.Model/BR.cs b/BRServer.Model/BR.cs
deleted file mode 100644
index 3c71a94..0000000
--- a/BRServer.Model/BR.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BRServer.Model
-{
- public class BR
- {
- private long dbId;
- private string devCode;
- private DateTime logTime;
- private string cell;
- private float sedimentation;
- private DateTime upTime;
-
- public long DBID
- {
- get { return dbId; }
- set { dbId = value; }
- }
-
- public string DEVCODE
- {
- get { return devCode; }
- set { devCode = value; }
- }
-
- public DateTime LOGTIME
- {
- get { return logTime; }
- set { logTime = value; }
- }
-
- public string CELL
- {
- get { return cell; }
- set { cell = value; }
- }
-
- public float SEDIMENTATION
- {
- get { return sedimentation; }
- set { sedimentation = value; }
- }
-
- public DateTime UPTIME
- {
- get { return upTime; }
- set { upTime = value; }
- }
- }
-}
diff --git a/BRServer/BRTagHandler.cs b/BRServer/BRTagHandler.cs
deleted file mode 100644
index 8428f7f..0000000
--- a/BRServer/BRTagHandler.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace BRServer
-{
- public class BRTagHandler:TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- if (!(tag is UploadTag))
- {
- return false;
- }
-
- UploadTag uploadTag = tag as UploadTag;
-
- return uploadTag.BizType == 18 ? true : false;//业务类型
- }
-
- public override void execute(Tag tag,String devCode,CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- //TODO LIST:解析数据,保存数据
- UploadTag BRTag = tag as UploadTag;
- int itv = BRTag.CollectInter;
- String collecTime = BRTag.CollectTime;
- int len = BRTag.Len;
- String dataValue = BRTag.DataValue;
-
- session.Logger.Info("北燃沉降监测仪数据上传TAG:oid:" + BRTag.Oid + " 采集间隔: " +
- itv + " 采集时间:" + collecTime + " 上传数值:" + dataValue);
-
- int num = len / 8;
- List djs = new List();
-
- DateTime baseTime = Convert.ToDateTime(systemDateTag.CollectDate + " " + collecTime);
- for (int i = 0; i < num; i++)
- {
- Model.BR BRInfo = new Model.BR();
- float sedimentation = strHexToSingle(dataValue.Substring(i * 8, 8));
-
- //TODO LIST:电池电量
- BRInfo.CELL = (cellTag == null ? "" : cellTag.Cell);
- BRInfo.SEDIMENTATION = sedimentation;
- BRInfo.LOGTIME = DateTime.Now;
- BRInfo.UPTIME = baseTime.AddMinutes(i * itv);
- BRInfo.DEVCODE = devCode;
- djs.Add(BRInfo);
- }
-
- BLL.BR.getInstance().insert(djs);
- session.Logger.Info("北燃沉降监测仪数据保存成功");
- }
-
- //网络序列转int
- private float strHexToSingle(String src)
- {
- if (src.Length != 8)
- return 0;
-
- byte[] lBt ={
- byte.Parse(src.Substring(0,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(2,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(4,2),System.Globalization.NumberStyles.HexNumber),
- byte.Parse(src.Substring(6,2),System.Globalization.NumberStyles.HexNumber)
- };
- return BitConverter.ToSingle(lBt, 0);
- }
- }
-}
diff --git a/BRServer/CellTagHandler.cs b/BRServer/CellTagHandler.cs
deleted file mode 100644
index 156aeac..0000000
--- a/BRServer/CellTagHandler.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace BRServer
-{
- public class CellTagHandler : TagHandler
- {
- public override bool isThisTag(Tag tag)
- {
- return tag is CellTag ? true : false;
- }
-
- public override void execute(Tag tag, String devCode, CellTag cellTag,
- SystemDateTag systemDateTag,CasicSession session)
- {
- session.Logger.Info("电量TAG:oid:" + cellTag.Oid +
- " 电量:" + cellTag.Cell);
- }
-
- }
-}
diff --git a/bin/BRCJServerTest.vshost.exe.config b/bin/BRCJServerTest.vshost.exe.config
deleted file mode 100644
index fe3c554..0000000
--- a/bin/BRCJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRCJServerTest.vshost.exe.manifest b/bin/BRCJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRCJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bin/BRKKJServerTest.vshost.exe.config b/bin/BRKKJServerTest.vshost.exe.config
deleted file mode 100644
index c65e387..0000000
--- a/bin/BRKKJServerTest.vshost.exe.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bin/BRKKJServerTest.vshost.exe.manifest b/bin/BRKKJServerTest.vshost.exe.manifest
deleted file mode 100644
index 061c9ca..0000000
--- a/bin/BRKKJServerTest.vshost.exe.manifest
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bin/Logs/debug.log20190311 b/bin/Logs/debug.log20190311
deleted file mode 100644
index 4065b04..0000000
--- a/bin/Logs/debug.log20190311
+++ /dev/null
@@ -1,34 +0,0 @@
-2019-03-11 16:55:14,372 [5156] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 16:55:14,413 [5156] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 16:55:14,425 [5156] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 16:55:16,968 [5156] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 16:55:16,968 [5156] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 16:55:17,000 [5156] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 16:56:28,539 [2036] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 16:56:28,593 [2036] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 16:56:28,605 [2036] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 16:56:31,112 [2036] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 16:56:31,112 [2036] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 16:56:31,141 [2036] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 16:56:31,146 [2036] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 17:28:54,258 [7856] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 17:28:54,297 [7856] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 17:28:54,309 [7856] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 17:28:56,960 [7856] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 17:28:56,960 [7856] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 17:28:56,994 [7856] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 17:28:56,999 [7856] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 17:32:25,419 [9056] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 17:32:25,456 [9056] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 17:32:25,469 [9056] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 17:32:28,049 [9056] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 17:32:28,049 [9056] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 17:32:28,088 [9056] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 17:32:28,092 [9056] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
-2019-03-11 18:02:05,789 [2420] DEBUG DefaultBootstrap - The server instance TelecomServer has been created!
-2019-03-11 18:02:05,826 [2420] DEBUG TelecomServer - The command Casic(BRCJServer.CasicCmd, BRCJServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) has been discovered
-2019-03-11 18:02:05,838 [2420] DEBUG DefaultBootstrap - The server instance TelecomServer has been initialized!
-2019-03-11 18:02:08,435 [2420] DEBUG DefaultBootstrap - The PerformanceMonitor has been initialized!
-2019-03-11 18:02:08,435 [2420] DEBUG DefaultBootstrap - The Bootstrap has been initialized!
-2019-03-11 18:02:08,474 [2420] DEBUG TelecomServer - Listener (0.0.0.0:50000) was started
-2019-03-11 18:02:08,479 [2420] DEBUG DefaultBootstrap - The PerformanceMonitor has been started!
diff --git a/bin/Logs/err.log20190311 b/bin/Logs/err.log20190311
deleted file mode 100644
index d037cfc..0000000
--- a/bin/Logs/err.log20190311
+++ /dev/null
@@ -1,42 +0,0 @@
-2019-03-11 16:52:50,558 [3160] ERROR DefaultBootstrap - Failed to create server instance TelecomServer!
-System.IO.FileNotFoundException: δ�ܼ����ļ������BRKKJServer��������ijһ�������ϵͳ�Ҳ���ָ�����ļ���
-���:��BRKKJServer��
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
- �� System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
- �� System.Type.GetType(String typeName, Boolean throwOnError)
- �� SuperSocket.SocketEngine.DefaultBootstrap.CreateWorkItemInstance(String serviceTypeName, StatusInfoAttribute[] serverStatusMetadata)
- �� SuperSocket.SocketEngine.DefaultBootstrap.InitializeAndSetupWorkItem(WorkItemFactoryInfo factoryInfo)
-
-=== Ԥ��״̬��Ϣ ===
-��־: DisplayName = BRKKJServer
- (Partial)
-����: Ϊ�����ṩ�˲��ְ���Ϣ:
-����: ��������: BRKKJServer | �� ID: 1
-����: �����ṩ������ʾ���Ƶ�һ����ʱ�����������ְ�
-����: ����ܵ������������ش���ij���
-����: ����Ϊ�����ṩ��ȫָ�������ֱ�ʶ��
-����: ���ɼ����ơ��汾�������Ժ�Կ�����ɡ�
-����: �йش��������ϸ��Ϣ�ͳ��������������μ���Ƥ�� http://go.microsoft.com/fwlink/?LinkId=109270��
-��־: Appbase = file:///E:/gwq/BRCJServer/bin/
-��־: ��ʼ PrivatePath = NULL
-����: SuperSocket.SocketEngine, Version=1.6.2.0, Culture=neutral, PublicKeyToken=6c80000676988ebb��
-===
-��־: �˰� default ���������Ŀ�ʼ��
-��־: ����ʹ��Ӧ�ó��������ļ�: E:\gwq\BRCJServer\bin\BRCJServerTest.vshost.exe.config
-��־: ʹ�����������ļ�:
-��־: ʹ�� C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config �ļ���������ļ���
-��־: ��ʱû��Ϊ����Ӧ�ò���(˽�С��Զ��塢�ֲ������λ�õij���)��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer.DLL��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer/BRKKJServer.DLL��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer.EXE��
-��־: ���������µ� URL file:///E:/gwq/BRCJServer/bin/BRKKJServer/BRKKJServer.EXE��
-
-2019-03-11 16:53:58,108 [6852] ERROR DefaultBootstrap - Failed to create server instance TelecomServer!
-System.TypeLoadException: δ�ܴӳ���BRCJServer���м������͡�BRCJServer.TelecomServer����
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
- �� System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
- �� System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
- �� System.Type.GetType(String typeName, Boolean throwOnError)
- �� SuperSocket.SocketEngine.DefaultBootstrap.CreateWorkItemInstance(String serviceTypeName, StatusInfoAttribute[] serverStatusMetadata)
- �� SuperSocket.SocketEngine.DefaultBootstrap.InitializeAndSetupWorkItem(WorkItemFactoryInfo factoryInfo)
diff --git a/bin/Logs/info.log20190311 b/bin/Logs/info.log20190311
deleted file mode 100644
index 57ba5f6..0000000
--- a/bin/Logs/info.log20190311
+++ /dev/null
@@ -1,4 +0,0 @@
-2019-03-11 16:56:31,142 [2036] INFO TelecomServer - The server instance TelecomServer has been started!
-2019-03-11 17:28:56,994 [7856] INFO TelecomServer - The server instance TelecomServer has been started!
-2019-03-11 17:32:28,088 [9056] INFO TelecomServer - The server instance TelecomServer has been started!
-2019-03-11 18:02:08,475 [2420] INFO TelecomServer - The server instance TelecomServer has been started!
diff --git a/bin/Logs/perf.log20190311 b/bin/Logs/perf.log20190311
deleted file mode 100644
index a88a88e..0000000
--- a/bin/Logs/perf.log20190311
+++ /dev/null
@@ -1,56 +0,0 @@
-2019-03-11 16:56:31,202 Performance - ---------------------------------------------------
-CPU Usage: 0.00%, Physical Memory Usage: 46,104,576.00, Total Thread Count: 27
-AvailableWorkingThreads: 1022, AvailableCompletionPortThreads: 1000
-MaxWorkingThreads: 1023, MaxCompletionPortThreads: 1000
-TelecomServer ----------------------------------
-Started Time: 2019/3/11 16:56:31
-Is Running: True
-Total Connections: 0
-Maximum Allowed Connection Number: 100
-Total Handled Requests: 0
-Request Handling Speed (#/second): 0
-Avialable Sending Queue Items: 256
-Total Sending Queue Items: 256
-
-2019-03-11 17:28:57,059 Performance - ---------------------------------------------------
-CPU Usage: 0.00%, Physical Memory Usage: 44,605,440.00, Total Thread Count: 25
-AvailableWorkingThreads: 1022, AvailableCompletionPortThreads: 1000
-MaxWorkingThreads: 1023, MaxCompletionPortThreads: 1000
-TelecomServer ----------------------------------
-Started Time: 2019/3/11 17:28:56
-Is Running: True
-Total Connections: 0
-Maximum Allowed Connection Number: 100
-Total Handled Requests: 0
-Request Handling Speed (#/second): 0
-Avialable Sending Queue Items: 256
-Total Sending Queue Items: 256
-
-2019-03-11 17:32:28,173 Performance - ---------------------------------------------------
-CPU Usage: 0.00%, Physical Memory Usage: 46,227,456.00, Total Thread Count: 25
-AvailableWorkingThreads: 1022, AvailableCompletionPortThreads: 1000
-MaxWorkingThreads: 1023, MaxCompletionPortThreads: 1000
-TelecomServer ----------------------------------
-Started Time: 2019/3/11 17:32:28
-Is Running: True
-Total Connections: 0
-Maximum Allowed Connection Number: 100
-Total Handled Requests: 0
-Request Handling Speed (#/second): 0
-Avialable Sending Queue Items: 256
-Total Sending Queue Items: 256
-
-2019-03-11 18:02:08,545 Performance - ---------------------------------------------------
-CPU Usage: 0.00%, Physical Memory Usage: 44,638,208.00, Total Thread Count: 25
-AvailableWorkingThreads: 1022, AvailableCompletionPortThreads: 1000
-MaxWorkingThreads: 1023, MaxCompletionPortThreads: 1000
-TelecomServer ----------------------------------
-Started Time: 2019/3/11 18:02:08
-Is Running: True
-Total Connections: 0
-Maximum Allowed Connection Number: 100
-Total Handled Requests: 0
-Request Handling Speed (#/second): 0
-Avialable Sending Queue Items: 256
-Total Sending Queue Items: 256
-