Methods
(async) WDwdataTweq(yearStart, yearEnd, optopt) → {Object}
- Description:
基於檔案之下載台灣氣象署地震數據與任務建構器
因各檔案小,真實數據直接視為hash數據做差異比對
執行階段最新數據放置於fdDwAttime,前次數據會於結束前自動備份至fdDwCurrent
- Source:
Example
import w from 'wsemi'
import WDwdataTweq from './src/WDwdataTweq.mjs'
//fdTagRemove
let fdTagRemove = `./_tagRemove`
w.fsCleanFolder(fdTagRemove)
//fdDwAttime
let fdDwAttime = `./_dwAttime`
w.fsCleanFolder(fdDwAttime)
//fdDwCurrent
let fdDwCurrent = `./_dwCurrent`
w.fsCleanFolder(fdDwCurrent)
//fdResult
let fdResult = `./_result`
w.fsCleanFolder(fdResult)
//fdTaskCpActualSrc
let fdTaskCpActualSrc = `./_taskCpActualSrc`
w.fsCleanFolder(fdTaskCpActualSrc)
//fdTaskCpSrc
let fdTaskCpSrc = `./_taskCpSrc`
w.fsCleanFolder(fdTaskCpSrc)
let yearStart = 2022
let yearEnd = 2022
let opt = {
fdTagRemove,
fdDwAttime,
fdDwCurrent,
fdResult,
fdTaskCpActualSrc,
fdTaskCpSrc,
// fdLog,
// funDownload,
// funGetCurrent,
// funRemove,
// funAdd,
// funModify,
}
let ev = await WDwdataTweq(yearStart, yearEnd, opt)
.catch((err) => {
console.log(err)
})
ev.on('change', (msg) => {
delete msg.type
console.log('change', msg)
})
// change { event: 'start', msg: 'running...' }
// change { event: 'proc-callfun-afterStart', msg: 'start...' }
// change { event: 'proc-callfun-afterStart', msg: 'done' }
// change { event: 'proc-callfun-download', msg: 'start...' }
// change { event: 'proc-callfun-download', num: 2, msg: 'done' }
// change { event: 'proc-callfun-getCurrent', msg: 'start...' }
// change { event: 'proc-callfun-getCurrent', num: 0, msg: 'done' }
// change { event: 'proc-compare', msg: 'start...' }
// change { event: 'proc-compare', numRemove: 0, numAdd: 2, numModify: 0, numSame: 0, msg: 'done' }
// change { event: 'proc-add-callfun-add', id: '111001', msg: 'start...' }
// change { event: 'proc-add-callfun-add', id: '111001', msg: 'done' }
// change { event: 'proc-add-callfun-add', id: '111002', msg: 'start...' }
// change { event: 'proc-add-callfun-add', id: '111002', msg: 'done' }
// ...
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
yearStart |
Integer | 輸入數據開始年整數 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
yearEnd |
Integer | 輸入數據結束年整數 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳事件物件,可呼叫函數on監聽change事件
- Type
- Object