public xValveView xView; // = new xValveView(); public xValveData() { for (int i = 0; i < acValveName.Length; i++) { acValveName[i] = 0; } xCmd = new xValveCtrlCmd(); xView = new xValveView(); }
public xValveData(byte[] b) { int offset = 0; Array.Copy(b, offset, acValveName, 0, acValveName.Length); offset += (((acValveName.Length + 1) >> 1) << 1); byte[] xValveCtrlCmdData = new byte[xValveCtrlCmd.DataSizeof]; Array.Copy(b, offset, xValveCtrlCmdData, 0, xValveCtrlCmd.DataSizeof); offset = (((xValveCtrlCmd.DataSizeof + acValveName.Length + 3) >> 2) << 2); xCmd = new xValveCtrlCmd(xValveCtrlCmdData); byte[] xValveViewData = new byte[xValveView.DataSizeof]; Array.Copy(b, offset, xValveViewData, 0, xValveView.DataSizeof); //offset += xValveView.DataSizeof; xView = new xValveView(xValveViewData); }