/// <summary> /// 浏览完目录后,将文件添加到文件列表 /// </summary> /// <param name="hfInfor"></param> private bool setFUpdataInterface(HexFileBean hfInfor) { if (updataDTyp == DrivaceTypeAll.USB_DANGLE) { return(false); } DrivaceTypeAll dt = fUpdataInterface.getType(); if (setDType != dt) { MessageBox.Show(StringUtils.hexFileNoType); return(false); } if (setDType == DrivaceTypeAll.NODE) { pathSet(textBox1, hfInfor.Path); //textBox1.Text = path; return(true); } /*else if (setDType == DrivaceType.CANKAODIAN) * { * pathSet(textBox18, hfInfor.Path); //tb.Text = path; * return true; * } * else if (dt == DrivaceType.CARD) * { * byte sunType = fUpdataInterface.sunDeviceType(); * tagPathSet(hfInfor.Path, tagBtnIndex, sunType); * return true; * }*/ return(false); }
public void readAllParameter(DrivaceTypeAll driType, byte[] ID) { if (driType == DrivaceTypeAll.NODE) { new Thread(readNODEParameter).Start(ID); } }
public void sendBinData(DrivaceTypeAll dType, byte[] ID, byte[] Addr) { if (fUpdataInterface == null || this.selectNodeID == null) { return; } fUpdataInterface.sendBinData(dType, this.selectNodeID, Addr); }
public void setNODEUnanswer(string NODEId, uint sleepTime, string quYuID, string canKaoDianID, long drivaceUpTime) { setLowEle(NODEId, 0, quYuID, canKaoDianID, drivaceUpTime); drivaceName = getFileNODEName(NODEId); drivace = DrivaceTypeAll.NODE; warnTp = WarnType.NODE_UNANSWERED; this.sleepTime = sleepTime; }
private bool isClear = false; //是否清理 public void setLowEle(string cardId, int currentElectricity, string quYuID, string canKaoDianID, long drivaceUpTime) { drivace = DrivaceTypeAll.CARD; warnTp = WarnType.CARD_LOW_ELECTRICITY; drivaceID = cardId; drivaceName = getFileCardName(cardId); this.quYuID = quYuID; this.drivaceUpTime = drivaceUpTime; quYuName = getFilequYuName(canKaoDianID); this.canKaoDianID = canKaoDianID; canKaoDianName = getFileNODEName(canKaoDianID); warnTime = XwDataUtils.GetTimeStamp(); this.currentElectricity = currentElectricity; dealWarnTime = 0; }
private void startRefech(DrivaceTypeAll dtype) { if (selectNodeID == null && dtype != DrivaceTypeAll.CARD) { MessageBox.Show(StringUtils.errorID); return; } if (!selectFileUpdataInterface(dtype)) { MessageBox.Show(StringUtils.hexFileAddErr); return; } if (fUpdataInterface == null) { MessageBox.Show(StringUtils.operationFailed); return; } if (fUpdataInterface.getType() != dtype) { MessageBox.Show(StringUtils.errorHexFile); return; } if (sunType != fUpdataInterface.sunDeviceType() && dtype != DrivaceTypeAll.CARD) { MessageBox.Show(StringUtils.hexFileNoType); return; } if (dtype != DrivaceTypeAll.CARD) { if (canKaoDianInfors.ContainsKey(selectNodeID[0].ToString("X2") + selectNodeID[1].ToString("X2"))) { byte[] version = canKaoDianInfors[selectNodeID[0].ToString("X2") + selectNodeID[1].ToString("X2")].Version; if (XWUtils.byteBTBettow(version, fileModel.HfModelInfor.TimeVersion, version.Length)) { MessageBox.Show(StringUtils.isNewVersin); return; } } } setDType = dtype; updataDTyp = dtype; byte[] Addr = { 0, 0 }; fUpdataInterface.start((byte)tagBtnIndex); sendBinData(setDType, selectNodeID, Addr); }
public void sendBinData(DrivaceTypeAll dType, byte[] ID, byte[] Addr) { if (stopUpData || hfModelInfor == null || hfModelInfor.G_bin == null || ID == null) { return; } if (Addr[0] == 0 && Addr[1] == 0) { isUpdata = true; drType = dType; if (dType != DrivaceTypeAll.USB_DANGLE) { new Thread(sendData_BinThread).Start(); } this.ID = ID; } this.Addr = Addr; new Thread(sendData_Bin).Start(); }
public NODESearchForm(string nodeID, Dictionary <string, CanKaoDianUpInfo> canKaoDianInfors) { InitializeComponent(); this.Text = "透傳設備" + nodeID; this.nodeID = nodeID; createCanKaoDianUpInfo(); maincanKaoDianInfors = new Dictionary <string, CanKaoDianUpInfo>(canKaoDianInfors); string ipInfo = ""; if (canKaoDianInfors.ContainsKey(nodeID)) { nodesearchModel = new NODESearchModel(canKaoDianInfors[nodeID], this); ipInfo = canKaoDianInfors[nodeID].IpInfo; } else { nodesearchModel = new NODESearchModel(null, this); } addFileUpDataModel(ipInfo); setDType = DrivaceTypeAll.NODE; updataDTyp = DrivaceTypeAll.NODE; }
private bool selectFileUpdataInterface(DrivaceTypeAll dtype) { return(selectFileModel(textBox1.Text)); }
/// <summary> /// 一键读取所有参数 /// </summary> /// <param name="dt"></param> /// <param name="ID"></param> private void readAllcanShu(DrivaceTypeAll dt, byte[] ID) { clearReadTextBox(); nodesearchModel.readAllParameter(dt, ID); }
public FormDialog(DrivaceTypeAll drivaceType) : this() { this.drivaceType = drivaceType; }