[ InTouch / 인터치 ] TrendClinet 기능 중 원하는 일자/시각별 조회방법
- 작성일2020/11/04 14:47
- 조회 280
TrendClient를 이용하여 구현하였습니다.
1. 조회 버튼에 사용된 스크립트:
{TrendClient1.TimeSelector.SetStartAndEndTimes(StartTime1, EndTime1, 0);}
mStartTime1 = Text(iTrendMonth1,"00/") + Text(iTrendDay1,"00/") + Text(iTrendYear1,"0000") + " " + Text(iTrendHourStart1,"00:") + Text(iTrendMinuteStart1,"00:") + "00";
mEndTime1 = Text(iTrendMonth1,"00/") + Text(iTrendDay1,"00/") + Text(iTrendYear1,"0000") + " " + Text(iTrendHourEnd1,"00:") + Text(iTrendMinuteEnd1,"00:") + "00";
iDuration1 = (iTrendHourEnd1 * 3600 + iTrendMinuteEnd1 * 60) - (iTrendHourStart1 * 3600 + iTrendMinuteStart1 * 60);
LogMessage("iDuration1 is..." + Text(iDuration1,"####,###"));
iDurationHH1 = iDuration1/3600;
iDurationMM1 = (iDuration1 - iDurationHH1 * 3600) / 60;
mDuration1 = TEXT(iDurationHH1, "00:") + TEXT(iDurationMM1, "00:")+"00";
TrendClient1.SetDuration(mDuration1);
LogMessage("mDuration1 is..." + mDuration1);
TrendClient1.TimeSelector.SetStartAndEndTimes(mStartTime1,mEndTime1, 0);
TrendClient1.RefreshData();
{("08/31/2008 15:33:43","09/01/2009 15:33:43",0 }
search01=1;
2. Trend Recent 조회
TimeSelector.TimeDuration
The TimeSelector.TimeDuration property is a read-write enumerated property that gets or sets the enumerated duration of the time axis of the chart.
Syntax
TimeSelector.TimeDuration = enum;
Result = TimeSelector.TimeDuration;
The TimeSelector.TimeDuration property is a read-write integer property that gets or sets the time duration. The start time of the Trend Client (TimeSelector.StartDate) is calculated as the end time (TimeSelector.EndDate) minus the new time duration.
The TimeSelector.TimeDuration can have one of the following values:
Value De_script_ion
0 Custom
1 The last minute.
2 The last five minutes.
3 The last ten minutes.
4 The last 15 minutes.
5 The last 30 minutes.
6 The last hour.
7 The last two hours.
8 The last four hours.
9 The last eight hours.
10 The last 12 hours.
11 The last 24 hours.
12 The last two days.
13 The last week.
14 The last two weeks.
15 The last month.
16 The last three months.
17 One minute.
18 Five minutes.
19 Ten minutes.
20 15 minutes.
21 30 minutes.
22 One hour.
23 Two hours.
24 Four hours.
25 Eight hours.
26 12 hours.
27 24 hours.
28 Two days.
29 One week.
30 Two weeks.
31 One month.
32 Three months.
33 Yesterday: 0:00:00 of the previous day to 0:00:00 of the current day.
34 Current day: 0:00:00 of the current day to the current time.
35 Previous hour: The start of the previous hour to the start of the current hour.
36 Current hour: The start of the current hour to the current time.
Syntax
result = TimeSelector.TimeDuration;
TimeSelector.TimeDuration = Value;
Example
Trend01.TimeSelector.TimeDuration = 5;
// The trend is now set to show the last 30 minutes.
Remarks
The default is 18 (5 minutes).