Ejemplo n.º 1
0
 private static void ConvertTime(FaultRecordService.time startTime, DateTime startTime1)
 {
     startTime.day     = startTime1.Day;
     startTime.hour    = startTime1.Hour;
     startTime.minute  = startTime1.Minute;
     startTime.month   = startTime1.Month;
     startTime.msecond = startTime1.Millisecond;
     startTime.second  = startTime1.Second;
     startTime.year    = startTime1.Year;
 }
Ejemplo n.º 2
0
 /// <remarks/>
 public void getFaultRecordByRecorderNameAsync(string arg0, time arg1, time arg2, object userState)
 {
     if ((this.getFaultRecordByRecorderNameOperationCompleted == null))
     {
         this.getFaultRecordByRecorderNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetFaultRecordByRecorderNameOperationCompleted);
     }
     this.InvokeAsync("getFaultRecordByRecorderName", new object[] {
         arg0,
         arg1,
         arg2
     }, this.getFaultRecordByRecorderNameOperationCompleted, userState);
 }
Ejemplo n.º 3
0
 /// <remarks/>
 public void getFaultRecordByRecorderNameAsync(string arg0, time arg1, time arg2)
 {
     this.getFaultRecordByRecorderNameAsync(arg0, arg1, arg2, null);
 }
Ejemplo n.º 4
0
        public faultRecordRtn getFaultRecordByRecorderName([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string arg0, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] time arg1, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] time arg2)
        {
            object[] results = this.Invoke("getFaultRecordByRecorderName", new object[] {
                arg0,
                arg1,
                arg2
            });

            return((faultRecordRtn)(results[0]));
        }
Ejemplo n.º 5
0
 /// <remarks/>
 public void getFaultRecordByMainstationNameAsync(string arg0, time arg1, time arg2)
 {
     this.getFaultRecordByMainstationNameAsync(arg0, arg1, arg2, null);
 }
Ejemplo n.º 6
0
        private void LineQuery(DateTime startTime1, DateTime endTime1)
        {
            stw.Start();

            int    FRrtn   = -1;
            string FRerror = "";

            try
            {
                录波采集测试工具.FaultRecordService.FaultRecordServiceService FRService = new FaultRecordService.FaultRecordServiceService();
                录波采集测试工具.FaultRecordService.time           startTime            = new FaultRecordService.time(); // tbxWaveStartTime.Text;
                录波采集测试工具.FaultRecordService.time           endTime          = new FaultRecordService.time();     // tbxWaveStartTime.Text;
                录波采集测试工具.FaultRecordService.faultRecordRtn FRfaultRecordRtn = new FaultRecordService.faultRecordRtn();


                writeLog("采集数据开始", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));

                try
                {
                    ConvertTime(startTime, startTime1);
                    ConvertTime(endTime, endTime1);
                }
                catch (Exception ex)
                {
                    writeLog("异常" + ex.ToString(), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));
                }

                // writeLog("***time类型 startTime" + startTime.ToString() + "endtime" + endTime.ToString(), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));

                if (j < subList.Count)
                {
                    writeLog(j + "行199当前使用的参数值变电站名:" + subList[j] + "时间:starttime:" + startTime.year + startTime.month + startTime.day + startTime.hour + startTime.minute + startTime.second + "endtime::" + endTime.year + endTime.month + endTime.day + endTime.hour + endTime.minute + endTime.second, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));

                    FRfaultRecordRtn = FRService.getFaultRecordByStationName(subList[j], startTime, endTime);
                    //FRService.getFaultRecordByDeviceOneName(tbxdeviceOneName.Text, startTime, endTime);
                    // FRService.getFaultRecordByStationName(tbxdeviceOneName.Text, startTime, endTime);

                    //FRrtn = FRService.getFaultRecordByStationName(tbxdeviceOneName.Text, startTime, endTime).rtn;
                    //FRerror = FRService.getFaultRecordByStationName(tbxdeviceOneName.Text, startTime, endTime).error;
                    //FRfaultRecordRtn.faultRecords = FRService.getFaultRecordByStationName(tbxdeviceOneName.Text, startTime, endTime).faultRecords;

                    FRrtn   = FRfaultRecordRtn.rtn;
                    FRerror = FRfaultRecordRtn.error;
                    writeLog("行211rtn值" + FRrtn.ToString() + "fr错误信息" + FRerror.ToString() + j, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));


                    //   writeLog("确定数组个数"+FRfaultRecordRtn.faultRecords.Length.ToString(), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));

                    if (FRfaultRecordRtn.faultRecords != null)
                    {
                        if (FRfaultRecordRtn.faultRecords.Length != 0)
                        {
                            for (int i = 0; i < FRfaultRecordRtn.faultRecords.Length; i++)
                            {
                                if (!String.IsNullOrEmpty(FRfaultRecordRtn.faultRecords[i].id.ToString()))
                                {
                                    writeLog("faultRecords不为空,返回rtn:" + FRrtn.ToString() + "返回error:" + FRerror + "返回faultRecordRtn" + "编号" + FRfaultRecordRtn.faultRecords[i].id.ToString() + "一次设备名" + FRfaultRecordRtn.faultRecords[i].deviceOneName.ToString() + "故障时间毫秒值" + FRfaultRecordRtn.faultRecords[i].faultTime.month.ToString() + "主站名" + FRfaultRecordRtn.faultRecords[i].stationName.ToString() + "录波器名" + FRfaultRecordRtn.faultRecords[i].recorderName.ToString() + "故障相别" + FRfaultRecordRtn.faultRecords[i].phase.ToString() + "故障测距" + FRfaultRecordRtn.faultRecords[i].location.ToString(), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));

                                    if (FRfaultRecordRtn.faultRecords[i].recorderType == 0)
                                    {//主变不处理
                                     //取编号进行下载文件
                                        RecordDownload(FRfaultRecordRtn.faultRecords[i].id, "_comtrade.cfg");
                                        RecordDownload(FRfaultRecordRtn.faultRecords[i].id, "_comtrade.dat");
                                        this.label1.Text = "工作中》》》》》》》";
                                        stw.Stop();
                                        writeLog("采集数据结束,耗时 " + stw.Elapsed.Minutes + "分 " + stw.Elapsed.Seconds + "秒" + stw.Elapsed.Milliseconds + "毫秒。", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));
                                        stw = new Stopwatch();//需要重新计时?
                                        j++;
                                    }
                                    else
                                    {
                                        j++;
                                        writeLog("主", "变");
                                        if (monoDebug == 2)
                                        {
                                            dataTimer.Change(Timeout.Infinite, -1);
                                            LineQuery(spa, spa + ts);
                                            // dataTimer.Change((timeDraw * 60 * 1000), (timeDraw * 60 * 1000));
                                            dataTimer.Change((timeDraw * 60 * 1000), (timeDraw * 60 * 1000));
                                        }
                                        else
                                        {
                                        }
                                    }
                                }
                                else
                                {
                                    j++;
                                    writeLog("faultRecordsID为空,返回rtn:" + FRrtn.ToString() + "返回error:" + FRerror + "返回faultRecordRtn" + "编号" + FRfaultRecordRtn.faultRecords[i].id.ToString() + "一次设备名" + FRfaultRecordRtn.faultRecords[i].deviceOneName.ToString() + "故障时间毫秒值" + FRfaultRecordRtn.faultRecords[i].faultTime.month.ToString() + "主站名" + FRfaultRecordRtn.faultRecords[i].stationName.ToString() + "录波器名" + FRfaultRecordRtn.faultRecords[i].recorderName.ToString() + "故障相别" + FRfaultRecordRtn.faultRecords[i].phase.ToString() + "故障测距" + FRfaultRecordRtn.faultRecords[i].location.ToString(), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));

                                    if (monoDebug == 2)
                                    {
                                        dataTimer.Change(Timeout.Infinite, -1);
                                        LineQuery(spa, spa + ts);
                                        // dataTimer.Change((timeDraw * 60 * 1000), (timeDraw * 60 * 1000));
                                        dataTimer.Change((timeDraw * 60 * 1000), (timeDraw * 60 * 1000));
                                    }
                                }
                            }
                        }
                        else
                        {
                            j++;
                            writeLog(j + "数组Length为空!变电站名:" + subList[j] + "时间:starttime:" + startTime.year + startTime.month + startTime.day + startTime.hour + startTime.minute + startTime.second + "endtime::" + endTime.year + endTime.month + endTime.day + endTime.hour + endTime.minute + endTime.second, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));  // subList[j], startTime, endTime
                            if (monoDebug == 2)
                            {
                                dataTimer.Change(Timeout.Infinite, -1);
                                LineQuery(spa, spa + ts);
                                // dataTimer.Change((timeDraw * 60 * 1000), (timeDraw * 60 * 1000));
                                dataTimer.Change((timeDraw * 60 * 1000), (timeDraw * 60 * 1000));
                            }
                            //j++;
                        }
                    }
                    else
                    {
                        writeLog(j + "FRfaultRecordRtn.faultRecords==null!变电站名:" + subList[j] + "时间:starttime:" + startTime.year + "/" + startTime.month + "/" + startTime.day + "/" + startTime.hour + "/" + startTime.minute + "/" + startTime.second + "endtime::" + endTime.year + "/" + endTime.month + "/" + endTime.day + "/" + endTime.hour + "/" + endTime.minute + "/" + endTime.second, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));  // subList[j], startTime, endTime
                        j++;
                        if (monoDebug == 2)
                        {
                            dataTimer.Change(Timeout.Infinite, -1);
                            LineQuery(spa, spa + ts);
                            // dataTimer.Change((timeDraw * 60 * 1000), (timeDraw * 60 * 1000));
                            dataTimer.Change((timeDraw * 60 * 1000), (timeDraw * 60 * 1000));
                        }
                    }
                }
                else if (j == subList.Count && spa < System.DateTime.Now)
                {
                    spa = spa + ts;
                    j   = 0;
                    if (FRfaultRecordRtn.faultRecords != null)
                    {
                        // dataTimer.Dispose();
                        // writeLog(j+ "尾部释放!尝试new立即启动" + j, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));  // subList[j], startTime, endTime
                        writeLog(j + "尾部!faultRecords不为空启动" + j, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));  // subList[j], startTime, endTime

                        dataTimer = new System.Threading.Timer(new TimerCallback(TimedEvent), null, 0, (timeDraw * 60 * 1000));
                    }
                    else
                    {
                        if (monoDebug == 2)
                        {
                            writeLog("数组尾部faultRecords为空!尝试立即启动" + j, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));  // subList[j], startTime, endTime
                            dataTimer = new System.Threading.Timer(new TimerCallback(TimedEvent), null, 0, (timeDraw * 60 * 1000));

                            // dataTimer.Change(0, 0);
                            //dataTimer.Change(Timeout.Infinite, -1);
                            //LineQuery(spa, spa + ts);
                            //// dataTimer.Change((timeDraw * 60 * 1000), (timeDraw * 60 * 1000));
                            //dataTimer.Change((timeDraw * 60 * 1000), (timeDraw * 60 * 1000));
                        }
                        else
                        {
                            dataTimer = new System.Threading.Timer(new TimerCallback(TimedEvent), null, 0, (timeDraw * 60 * 1000));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                writeLog("异常" + ex.ToString(), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff"));
            }
            // FRerror = FRService.getFaultRecordByDeviceOneName(tbxdeviceOneName.Text,,).error;
            //FaultRecordServiceService.getFaultRecordByDeviceOneName()
        }