X10
parent
6fb47d8a1f
commit
fb6d40571c
|
@ -8,7 +8,9 @@
|
|||
"name": "iar",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@highlightjs/vue-plugin": "^2.1.0",
|
||||
"element-plus": "^2.6.1",
|
||||
"highlight.js": "^11.9.0",
|
||||
"sass": "^1.71.1",
|
||||
"vue": "^3.4.19",
|
||||
"vue-router": "^4.3.0"
|
||||
|
@ -435,6 +437,15 @@
|
|||
"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz",
|
||||
"integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q=="
|
||||
},
|
||||
"node_modules/@highlightjs/vue-plugin": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@highlightjs/vue-plugin/-/vue-plugin-2.1.0.tgz",
|
||||
"integrity": "sha512-E+bmk4ncca+hBEYRV2a+1aIzIV0VSY/e5ArjpuSN9IO7wBJrzUE2u4ESCwrbQD7sAy+jWQjkV5qCCWgc+pu7CQ==",
|
||||
"peerDependencies": {
|
||||
"highlight.js": "^11.0.1",
|
||||
"vue": "^3"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/sourcemap-codec": {
|
||||
"version": "1.4.15",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
||||
|
@ -1022,6 +1033,14 @@
|
|||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/highlight.js": {
|
||||
"version": "11.9.0",
|
||||
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.9.0.tgz",
|
||||
"integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/immutable": {
|
||||
"version": "4.3.5",
|
||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.5.tgz",
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@highlightjs/vue-plugin": "^2.1.0",
|
||||
"element-plus": "^2.6.1",
|
||||
"highlight.js": "^11.9.0",
|
||||
"sass": "^1.71.1",
|
||||
"vue": "^3.4.19",
|
||||
"vue-router": "^4.3.0"
|
||||
|
|
137
src/js/INNcom.js
137
src/js/INNcom.js
|
@ -29,30 +29,7 @@ export const DEVICE_MODEL = {
|
|||
//#define BANKMGMTDEF_FLAVOR_AM_D454_FET 0x08000021
|
||||
//#define BANKMGMTDEF_FLAVOR_AM_D454_TRIAC 0x08000022
|
||||
|
||||
export const DefaultValue = {
|
||||
NormallyOpen: 0x02,
|
||||
NormallyClose: 0x82,
|
||||
}
|
||||
export function NEW_DIGITAL_INTPUT(PinID) {
|
||||
return {
|
||||
Pin: PinID,
|
||||
Func: "Null",
|
||||
P5Addr: 0,
|
||||
ConfFlags: DefaultValue.NormallyOpen,
|
||||
Options: 0x00,
|
||||
LightScene: {
|
||||
Name: 'SmartCircuitToggle',
|
||||
SuiteID: 0,
|
||||
SceneID: 0,
|
||||
LogicalCircuitID: 0,
|
||||
GuideID: 0,
|
||||
RotateSceneCnt: 2,
|
||||
RotateSceneID: [0, 1, 2, 3]
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const DIGITAL_INTPUT_FUNCTION = {
|
||||
export const DIGITAL_INPUT_FUNCTION = {
|
||||
Null: "空",
|
||||
LightScene: "灯光场景",
|
||||
EntryDoor: "房门门磁",
|
||||
|
@ -66,18 +43,124 @@ export const DIGITAL_INTPUT_FUNCTION = {
|
|||
ConnectingDoor: "连通门门磁",
|
||||
};
|
||||
|
||||
export const DIGITAL_INTPUT_LIGHT_SCENE = {
|
||||
export const DIGITAL_OUTPUT_FUNCTION = {
|
||||
Null: "空",
|
||||
DigitalOutput: "普通输出",
|
||||
LightOutput: "灯光输出",
|
||||
};
|
||||
|
||||
export const VIRTUAL_OUTPUT_FUNCTION = {
|
||||
Null: "空",
|
||||
GuideOutput: "参考回路",
|
||||
};
|
||||
|
||||
export const DIGITAL_INPUT_LIGHT_SCENE = {
|
||||
LightsAllOn_Room: "灯光全开",
|
||||
LightsAllOff_Room: "灯光全关",
|
||||
LightsAllOn_Suite: "套房灯光全开",
|
||||
LightsAllOff_Suite: "套房灯光全关",
|
||||
DimSet: "调光设定",
|
||||
DimToggle: "调光切换",
|
||||
LightCtr: "灯光控制",
|
||||
// LightCtr: "灯光控制",
|
||||
LightSceneClear: "灯光场景清除",
|
||||
LightSceneSet: "灯光场景设定",
|
||||
SceneClear: "场景清除",
|
||||
// SceneClear: "场景清除",
|
||||
SmartCircuitToggle: "智能回路切换",
|
||||
SmartSceneRotate: "智能场景循环",
|
||||
SmartSceneToggle: "智能场景切换",
|
||||
};
|
||||
|
||||
export const DefaultValue = {
|
||||
NormallyOpen: 0x02,
|
||||
NormallyClose: 0x82,
|
||||
}
|
||||
export function NEW_DIGITAL_INPUT(PinID) {
|
||||
return {
|
||||
Pin: PinID,
|
||||
Func: "Null",
|
||||
P5Addr: 0,
|
||||
ConfFlags: DefaultValue.NormallyOpen,
|
||||
Options: 0x00,
|
||||
LightScene: {
|
||||
Name: 'SmartCircuitToggle',
|
||||
LCFlag: 0,
|
||||
Circuit: 0,
|
||||
Level: 0,
|
||||
SuiteID: 0,
|
||||
SceneID: 0,
|
||||
LogicalCircuitID: 0,
|
||||
GuideID: 0,
|
||||
RotateSceneCnt: 2,
|
||||
RotateSceneID: [0, 1, 2, 3]
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export function NEW_DIGITAL_OUTPUT(PinID) {
|
||||
return {
|
||||
Pin: PinID,
|
||||
Func: "Null",
|
||||
LightOutput: {
|
||||
Welcome: false,
|
||||
WelcomeStaff: false,
|
||||
WelcomeStaffDelayMin: 0,
|
||||
WelcomeGuest: false,
|
||||
WelcomeGuestDelayMin: 0,
|
||||
LogicalCircuitList: [0, 0, 0, 0],
|
||||
SceneList: [{
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}, {
|
||||
Enable: false,
|
||||
Value: false,
|
||||
}],
|
||||
},
|
||||
DigitalOutput: {
|
||||
ConfFlags: 0x00,
|
||||
PI5_Ofs: 0x00,
|
||||
BitMask: 0x00,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
10
src/main.js
10
src/main.js
|
@ -5,10 +5,8 @@ import App from './App.vue'
|
|||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
import router from './router'
|
||||
import 'highlight.js/styles/androidstudio.css'
|
||||
import 'highlight.js/lib/common'
|
||||
import hljsVuePlugin from '@highlightjs/vue-plugin'
|
||||
|
||||
createApp(App).use(ElementPlus).use(router).mount('#app')
|
||||
// import 'highlight.js/styles/atom-one-dark.css'
|
||||
// import 'highlight.js/lib/common'
|
||||
// import hljsVuePlugin from '@highlightjs/vue-plugin'
|
||||
|
||||
// createApp(App).use(ElementPlus).use(router).use(hljsVuePlugin).mount('#app')
|
||||
createApp(App).use(ElementPlus).use(router).use(hljsVuePlugin).mount('#app')
|
||||
|
|
|
@ -26,8 +26,8 @@ body {
|
|||
margin: 0;
|
||||
display: flex;
|
||||
place-items: center;
|
||||
min-width: 320px;
|
||||
min-height: 100vh;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
h1 {
|
||||
|
@ -59,10 +59,10 @@ button:focus-visible {
|
|||
}
|
||||
|
||||
#app {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
|
@ -77,3 +77,20 @@ button:focus-visible {
|
|||
background-color: #f9f9f9;
|
||||
}
|
||||
}
|
||||
.el-header {
|
||||
display:flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
}
|
||||
.el-container {
|
||||
height: 100%;
|
||||
}
|
||||
.el-form-item {
|
||||
margin-top: 18px;
|
||||
}
|
||||
.el-form-item__content {
|
||||
>span {
|
||||
margin: 0 20px;
|
||||
}
|
||||
}
|
|
@ -11,9 +11,9 @@
|
|||
<el-icon><star-filled /></el-icon>
|
||||
</el-divider>
|
||||
|
||||
<el-form-item v-for="(dix, key, index) in device.DIGITAL_INTPUT" :key="index" :label="key">
|
||||
<el-form-item v-for="(dix, key, index) in device.DIGITAL_INPUT" :key="index" :label="key">
|
||||
<el-select v-model="dix.Func">
|
||||
<el-option v-for="(func_label, func_value, func_index) in DIGITAL_INTPUT_FUNCTION" :key="func_index"
|
||||
<el-option v-for="(func_label, func_value, func_index) in DIGITAL_INPUT_FUNCTION" :key="func_index"
|
||||
:label="func_label" :value="func_value" />
|
||||
</el-select>
|
||||
<div v-if="dix.Func === 'RingBell'">
|
||||
|
@ -46,9 +46,9 @@
|
|||
<div v-if="dix.Func === 'LightScene'">
|
||||
灯光场景配置
|
||||
<el-select v-model="dix.LightScene.Name">
|
||||
<el-option v-for="(scene_name, scene_value, scene_index) in DIGITAL_INTPUT_LIGHT_SCENE"
|
||||
<el-option v-for="(scene_name, scene_value, scene_index) in DIGITAL_INPUT_LIGHT_SCENE"
|
||||
:key="scene_index" :label="scene_name" :value="scene_value" />
|
||||
/></el-select>
|
||||
</el-select>
|
||||
<div v-if="dix.LightScene.Name === 'LightsAllOn_Suite' ||
|
||||
dix.LightScene.Name === 'LightsAllOff_Suite'
|
||||
">
|
||||
|
@ -58,16 +58,71 @@
|
|||
</div>
|
||||
<div v-if="dix.LightScene.Name === 'DimSet'">
|
||||
<el-form-item>
|
||||
<span>信号发送地址</span><el-input-number v-model="dix.P5Addr" :min="1" :max="99999" />
|
||||
<span>信号发送地址</span><el-input-number v-model="dix.P5Addr" :min="0" :max="99999" />
|
||||
<span>LCflag</span><el-input-number v-model="dix.LightScene.LCFlag" :min="1" :max="99999" />
|
||||
<span>回路</span><el-input-number v-model="dix.LightScene.Circuit" :min="1" :max="99999" />
|
||||
<span>Level</span><el-input-number v-model="dix.LightScene.Level" :min="1" :max="99999" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-if="dix.LightScene.Name === 'DimToggle'">
|
||||
<el-form-item>
|
||||
<span>信号发送地址</span><el-input-number v-model="dix.P5Addr" :min="0" :max="99999" />
|
||||
<span>回路</span><el-input-number v-model="dix.LightScene.Circuit" :min="1" :max="99999" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- <div v-if="dix.LightScene.Name === 'LightCtr'">
|
||||
<el-form-item>
|
||||
<span>信号发送地址</span><el-input-number v-model="dix.P5Addr" :min="0" :max="99999" />
|
||||
<span>LCflag</span><el-input-number v-model="dix.P5Addr" :min="1" :max="99999" />
|
||||
<span>回路</span><el-input-number v-model="dix.P5Addr" :min="1" :max="99999" />
|
||||
<span>Level</span><el-input-number v-model="dix.P5Addr" :min="1" :max="99999" />
|
||||
</el-form-item>
|
||||
</div> -->
|
||||
<div v-if="dix.LightScene.Name === 'LightSceneClear' || dix.LightScene.Name === 'LightSceneSet'">
|
||||
<el-form-item>
|
||||
<span>场景ID</span><el-input-number v-model="dix.LightScene.SceneID" :min="0" :max="48" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- <div v-if="dix.LightScene.Name === 'SceneClear'">
|
||||
<el-form-item>
|
||||
<span>信号发送地址</span><el-input-number v-model="dix.P5Addr" :min="0" :max="99999" />
|
||||
<span>LCflag</span><el-input-number v-model="dix.P5Addr" :min="1" :max="99999" />
|
||||
<span>回路</span><el-input-number v-model="dix.P5Addr" :min="1" :max="99999" />
|
||||
<span>Level</span><el-input-number v-model="dix.P5Addr" :min="1" :max="99999" />
|
||||
</el-form-item>
|
||||
</div> -->
|
||||
<div v-if="dix.LightScene.Name === 'SmartCircuitToggle'">
|
||||
<el-form-item>
|
||||
<span>信号发送地址</span><el-input-number v-model="dix.P5Addr" :min="0" :max="99999" />
|
||||
<span>逻辑回路ID</span><el-input-number v-model="dix.LightScene.LogicalCircuitID" :min="1"
|
||||
:max="99999" />
|
||||
<span>参考回路ID</span><el-input-number v-model="dix.LightScene.GuideID" :min="1" :max="16" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-if="dix.LightScene.Name === 'SmartSceneRotate'">
|
||||
<el-form-item>
|
||||
<span>信号发送地址</span><el-input-number v-model="dix.P5Addr" :min="0" :max="99999" />
|
||||
<span>场景数量</span><el-input-number v-model="dix.LightScene.RotateSceneCnt" :min="2" :max="4" />
|
||||
<span>场景1</span><el-input-number v-model="dix.LightScene.RotateSceneID[0]" :min="0" :max="48" />
|
||||
<span>场景2</span><el-input-number v-model="dix.LightScene.RotateSceneID[1]" :min="0" :max="48" />
|
||||
|
||||
<span v-if="dix.LightScene.RotateSceneCnt > 2">场景3</span><el-input-number
|
||||
v-model="dix.LightScene.RotateSceneID[2]" :min="0" :max="48"
|
||||
v-if="dix.LightScene.RotateSceneCnt > 2" />
|
||||
<span v-if="dix.LightScene.RotateSceneCnt > 3">场景4</span><el-input-number
|
||||
v-model="dix.LightScene.RotateSceneID[3]" :min="0" :max="48"
|
||||
v-if="dix.LightScene.RotateSceneCnt > 3" />
|
||||
|
||||
|
||||
|
||||
<span>参考回路ID</span><el-input-number v-model="dix.LightScene.GuideID" :min="1" :max="16" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-if="dix.LightScene.Name === 'SmartSceneToggle'">
|
||||
<el-form-item>
|
||||
<span>信号发送地址</span><el-input-number v-model="dix.P5Addr" :min="0" :max="99999" />
|
||||
<span>场景ID</span><el-input-number v-model="dix.LightScene.SceneID" :min="0" :max="48" />
|
||||
<span>参考回路ID</span><el-input-number v-model="dix.LightScene.GuideID" :min="1" :max="16" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
|
@ -77,38 +132,572 @@
|
|||
<el-icon><star-filled /></el-icon>
|
||||
</el-divider>
|
||||
|
||||
<el-form-item v-for="(dix, key, index) in device.DIGITAL_OUTPUT" :key="index" :label="key">
|
||||
<el-select v-model="dix.Func">
|
||||
<el-option v-for="(func_label, func_value, func_index) in DIGITAL_OUTPUT_FUNCTION" :key="func_index"
|
||||
:label="func_label" :value="func_value" />
|
||||
</el-select>
|
||||
<div v-if="dix.Func === 'DigitalOutput'">
|
||||
<el-form-item>
|
||||
<span>PI5_Ofs</span>
|
||||
<el-input-number v-model="dix.DigitalOutput.PI5_Ofs" :min="0" :max="99999" :controls="false" />
|
||||
<span>BitMask</span>
|
||||
<el-input-number v-model="dix.DigitalOutput.BitMask" :min="0" :max="99999" :controls="false" />
|
||||
<span>ConfFlags</span>
|
||||
<el-input-number v-model="dix.DigitalOutput.ConfFlags" :min="0" :max="99999" :controls="false" />
|
||||
</el-form-item>
|
||||
|
||||
</div>
|
||||
<div v-if="dix.Func === 'LightOutput'">
|
||||
<el-form-item>
|
||||
<span>欢迎模式</span>
|
||||
<el-switch v-model="dix.LightOutput.Welcome" inline-prompt active-text="参与" inactive-text="取消" />
|
||||
<span>员工欢迎模式</span>
|
||||
<el-switch v-model="dix.LightOutput.WelcomeStaff" inline-prompt active-text="参与"
|
||||
inactive-text="取消" />
|
||||
<el-input-number v-if="dix.LightOutput.WelcomeStaff" v-model="dix.LightOutput.WelcomeStaffDelayMin"
|
||||
:min="0" :max="99999" :controls="false" />
|
||||
<span>客人欢迎模式</span>
|
||||
<el-switch v-model="dix.LightOutput.WelcomeGuest" inline-prompt active-text="参与"
|
||||
inactive-text="取消" />
|
||||
<el-input-number v-if="dix.LightOutput.WelcomeGuest" v-model="dix.LightOutput.WelcomeGuestDelayMin"
|
||||
:min="0" :max="99999" :controls="false" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span v-for="(_, index) in dix.LightOutput.LogicalCircuitList" :key="index">
|
||||
参与的第{{ index }}个逻辑回路ID
|
||||
<el-input-number v-model="dix.LightOutput.LogicalCircuitList[index]" :min="0" :max="99999" />
|
||||
</span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span v-for="(_, index) in dix.LightOutput.SceneList" :key="index">
|
||||
场景{{ index.toString().padStart(2, '0') }}
|
||||
<el-switch v-model="dix.LightOutput.SceneList[index].Enable" inline-prompt active-text="参与"
|
||||
inactive-text="取消" />
|
||||
<el-switch v-if="dix.LightOutput.SceneList[index].Enable"
|
||||
v-model="dix.LightOutput.SceneList[index].Value" inline-prompt active-text="开灯"
|
||||
inactive-text="关灯" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" />
|
||||
</span>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-divider>
|
||||
<el-icon><star-filled /></el-icon>
|
||||
虚拟回路配置
|
||||
<el-icon><star-filled /></el-icon>
|
||||
</el-divider>
|
||||
|
||||
<el-form-item v-for="(dix, key, index) in device.VIRTUAL_OUTPUT" :key="index" :label="key">
|
||||
<el-select v-model="dix.Func">
|
||||
<el-option v-for="(func_label, func_value, func_index) in VIRTUAL_OUTPUT_FUNCTION" :key="func_index"
|
||||
:label="func_label" :value="func_value" />
|
||||
</el-select>
|
||||
<div v-if="dix.Func === 'GuideOutput'">
|
||||
<el-form-item>
|
||||
<span>欢迎模式</span>
|
||||
<el-switch v-model="dix.LightOutput.Welcome" inline-prompt active-text="参与" inactive-text="取消" />
|
||||
<span>员工欢迎模式</span>
|
||||
<el-switch v-model="dix.LightOutput.WelcomeStaff" inline-prompt active-text="参与"
|
||||
inactive-text="取消" />
|
||||
<el-input-number v-if="dix.LightOutput.WelcomeStaff" v-model="dix.LightOutput.WelcomeStaffDelayMin"
|
||||
:min="0" :max="99999" :controls="false" />
|
||||
<span>客人欢迎模式</span>
|
||||
<el-switch v-model="dix.LightOutput.WelcomeGuest" inline-prompt active-text="参与"
|
||||
inactive-text="取消" />
|
||||
<el-input-number v-if="dix.LightOutput.WelcomeGuest" v-model="dix.LightOutput.WelcomeGuestDelayMin"
|
||||
:min="0" :max="99999" :controls="false" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span v-for="(_, index) in dix.LightOutput.LogicalCircuitList" :key="index">
|
||||
参与的第{{ index }}个逻辑回路ID
|
||||
<el-input-number v-model="dix.LightOutput.LogicalCircuitList[index]" :min="0" :max="99999" />
|
||||
</span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span v-for="(_, index) in dix.LightOutput.SceneList" :key="index">
|
||||
场景{{ index.toString().padStart(2, '0') }}
|
||||
<el-switch v-model="dix.LightOutput.SceneList[index].Enable" inline-prompt active-text="参与"
|
||||
inactive-text="取消" />
|
||||
<el-switch v-if="dix.LightOutput.SceneList[index].Enable"
|
||||
v-model="dix.LightOutput.SceneList[index].Value" inline-prompt active-text="开灯"
|
||||
inactive-text="关灯" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" />
|
||||
</span>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">生成</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<el-dialog v-model="dialogVisible" title="生成代码">
|
||||
<div class="hljs-container" codetype="Personality.c">
|
||||
<el-button type="primary" @click="iar_code_copy">复制</el-button>
|
||||
<highlightjs language="c" :autodetect="false" :code="code"></highlightjs>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive } from "vue";
|
||||
import { StarFilled } from "@element-plus/icons-vue";
|
||||
import { DEVICE_MODEL, NEW_DIGITAL_INTPUT, DIGITAL_INTPUT_FUNCTION, DefaultValue, DIGITAL_INTPUT_LIGHT_SCENE } from '../js/INNcom.js'
|
||||
import { DEVICE_MODEL, NEW_DIGITAL_INPUT, DIGITAL_INPUT_FUNCTION, DefaultValue, DIGITAL_INPUT_LIGHT_SCENE, NEW_DIGITAL_OUTPUT, DIGITAL_OUTPUT_FUNCTION, VIRTUAL_OUTPUT_FUNCTION } from '../js/INNcom.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
const dialogVisible = ref(false);
|
||||
// 设备信息
|
||||
const device = reactive({
|
||||
ADDR: 0,
|
||||
ADDR: 1,
|
||||
MODEL: DEVICE_MODEL['X10'],
|
||||
DIGITAL_INTPUT: {
|
||||
DI1: NEW_DIGITAL_INTPUT(1),
|
||||
DI2: NEW_DIGITAL_INTPUT(2),
|
||||
DI3: NEW_DIGITAL_INTPUT(3),
|
||||
DI4: NEW_DIGITAL_INTPUT(4),
|
||||
DI5: NEW_DIGITAL_INTPUT(5),
|
||||
DI6: NEW_DIGITAL_INTPUT(6),
|
||||
DI7: NEW_DIGITAL_INTPUT(7),
|
||||
DI8: NEW_DIGITAL_INTPUT(8),
|
||||
DIGITAL_INPUT: {
|
||||
DI1: NEW_DIGITAL_INPUT(1),
|
||||
DI2: NEW_DIGITAL_INPUT(2),
|
||||
DI3: NEW_DIGITAL_INPUT(3),
|
||||
DI4: NEW_DIGITAL_INPUT(4),
|
||||
DI5: NEW_DIGITAL_INPUT(5),
|
||||
DI6: NEW_DIGITAL_INPUT(6),
|
||||
DI7: NEW_DIGITAL_INPUT(7),
|
||||
DI8: NEW_DIGITAL_INPUT(8),
|
||||
},
|
||||
DIGITAL_OUTPUT: {
|
||||
DO1: NEW_DIGITAL_OUTPUT(1),
|
||||
DO2: NEW_DIGITAL_OUTPUT(2),
|
||||
DO3: NEW_DIGITAL_OUTPUT(3),
|
||||
DO4: NEW_DIGITAL_OUTPUT(4),
|
||||
DO5: NEW_DIGITAL_OUTPUT(5),
|
||||
DO6: NEW_DIGITAL_OUTPUT(6),
|
||||
DO7: NEW_DIGITAL_OUTPUT(7),
|
||||
DO8: NEW_DIGITAL_OUTPUT(8),
|
||||
},
|
||||
VIRTUAL_OUTPUT: {
|
||||
VIR1: NEW_DIGITAL_OUTPUT(9),
|
||||
VIR2: NEW_DIGITAL_OUTPUT(10),
|
||||
VIR3: NEW_DIGITAL_OUTPUT(11),
|
||||
VIR4: NEW_DIGITAL_OUTPUT(12),
|
||||
VIR5: NEW_DIGITAL_OUTPUT(13),
|
||||
VIR6: NEW_DIGITAL_OUTPUT(14),
|
||||
VIR7: NEW_DIGITAL_OUTPUT(15),
|
||||
VIR8: NEW_DIGITAL_OUTPUT(16),
|
||||
}
|
||||
});
|
||||
let code = '';
|
||||
const onSubmit = () => {
|
||||
console.log(device);
|
||||
let code71 = '';
|
||||
Object.values(device.DIGITAL_INPUT).forEach((dix) => {
|
||||
switch (dix.Func) {
|
||||
case 'LightScene':
|
||||
switch (dix.LightScene) {
|
||||
case 'LightsAllOn_Room':
|
||||
code71 += `REG_HELPER_LowVoltageInput_LightsAllOn_Room(${dix.Pin});\n `
|
||||
break;
|
||||
case 'LightsAllOff_Room':
|
||||
code71 += `REG_HELPER_LowVoltageInput_LightsAllOff_Room(${dix.Pin});\n `
|
||||
break;
|
||||
case 'LightsAllOn_Suite':
|
||||
code71 += `REG_HELPER_LowVoltageInput_LightsAllOn_Suite(${dix.Pin},${dix.SuiteID});\n `
|
||||
break;
|
||||
case 'LightsAllOff_Suite':
|
||||
code71 += `REG_HELPER_LowVoltageInput_LightsAllOff_Suite(${dix.Pin},${dix.SuiteID});\n `
|
||||
break;
|
||||
case 'DimSet':
|
||||
code71 += `REG_HELPER_LowVoltageInput_DimSet(${dix.Pin},${dix.P5Addr},${dix.LCFlag},${dix.Circuit},${dix.Level});\n `
|
||||
break;
|
||||
case 'DimToggle':
|
||||
code71 += `REG_HELPER_LowVoltageInput_DimToggle(${dix.Pin},${dix.P5Addr},${dix.Circuit});\n `
|
||||
break;
|
||||
// case 'LightCtr':
|
||||
// code71 += `REG_HELPER_LowVoltageInput_LightCtr(${dix.Pin},${dix.P5Addr},${dix.Circuit});\n `
|
||||
// break;
|
||||
case 'LightSceneClear':
|
||||
code71 += `REG_HELPER_LowVoltageInput_LightSceneClear(${dix.Pin},${dix.SceneID});\n `
|
||||
break;
|
||||
case 'LightSceneSet':
|
||||
code71 += `REG_HELPER_LowVoltageInput_LightSceneSet(${dix.Pin},${dix.SceneID});\n `
|
||||
break;
|
||||
// case 'SceneClear':
|
||||
// code71 += `REG_HELPER_LowVoltageInput_LightSceneSet(${dix.Pin},${dix.SceneID});\n `
|
||||
// break;
|
||||
case 'SmartCircuitToggle':
|
||||
code71 += `REG_HELPER_LowVoltageInput_SmartCircuitToggle(${dix.Pin},${dix.P5Addr},${dix.LogicalCircuitID},${dix.GuideID});\n `
|
||||
break;
|
||||
case 'SmartSceneRotate':
|
||||
code71 += `REG_HELPER_LowVoltageInput_SmartSceneRotate(${dix.Pin},${dix.P5Addr},0,${dix.RotateSceneCnt},${dix.GuideID},${dix.RotateSceneID[0]},${dix.RotateSceneID[1]},${dix.RotateSceneID[2]},${dix.RotateSceneID[3]});\n `
|
||||
break;
|
||||
case 'SmartSceneToggle':
|
||||
code71 += `REG_HELPER_LowVoltageInput_SmartSceneToggle(${dix.Pin},${dix.P5Addr},0,${dix.SceneID},${dix.GuideID});\n `
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'EntryDoor':
|
||||
code71 += `REG_HELPER_LowVoltage_Input_StdCommonCtrl_EntryDoor(${dix.Pin},${dix.Pin},${dix.ConfFlags});\n `
|
||||
break;
|
||||
case 'RingBell':
|
||||
code71 += `REG_HELPER_LowVoltage_Input_RingBell(${dix.Pin},${dix.Pin},${dix.P5Addr},${dix.ConfFlags},${dix.Options});\n `
|
||||
break;
|
||||
case 'PIR_MotionSensor':
|
||||
code71 += `REG_HELPER_LowVoltage_Input_StdCommonCtrl_PIR_MotionSensor(${dix.Pin},${dix.Pin},${dix.ConfFlags});\n `
|
||||
break;
|
||||
case 'WindowBalcony':
|
||||
code71 += `REG_HELPER_LowVoltage_Input_StdCommonCtrl_WindowBalcony(${dix.Pin},${dix.Pin},${dix.ConfFlags});\n `
|
||||
break;
|
||||
case 'SmokeSensor':
|
||||
code71 += `REG_HELPER_LowVoltage_Input_StdCommonCtrl_SmokeSensor(${dix.Pin},${dix.Pin},${dix.ConfFlags});\n `
|
||||
break;
|
||||
case 'MinBarDoor':
|
||||
code71 += `REG_HELPER_LowVoltage_Input_StdCommonCtrl_MinBarDoor(${dix.Pin},${dix.Pin},${dix.ConfFlags});\n `
|
||||
break;
|
||||
case 'KeyTagSensor':
|
||||
code71 += `REG_HELPER_LowVoltage_Input_StdCommonCtrl_KeyTagSensor(${dix.Pin},${dix.Pin},${dix.ConfFlags});\n `
|
||||
break;
|
||||
case 'CommonDoor':
|
||||
code71 += `REG_HELPER_LowVoltage_Input_StdCommonCtrl_CommonDoor(${dix.Pin},${dix.Pin},${dix.ConfFlags});\n `
|
||||
break;
|
||||
case 'ConnectingDoor':
|
||||
code71 += `REG_HELPER_LowVoltage_Input_StdCommonCtrl_ConnectingDoor(${dix.Pin},${dix.Pin},${dix.ConfFlags});\n `
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
let code72 = '';
|
||||
let code73 = '';
|
||||
Object.values(device.DIGITAL_OUTPUT).forEach((dix) => {
|
||||
switch (dix.Func) {
|
||||
case 'DigitalOutput':
|
||||
code72 += `REG_HELPER_Output_PI5_Bit(${dix.Pin}, ${dix.PI5_Ofs}, ${dix.BitMask}, ${dix.ConfFlags});\n `
|
||||
break;
|
||||
case 'LightOutput':
|
||||
code73 += `
|
||||
Reg.BaseOutput.DriverIndex = CBL32_LO_DRIVER_INDEX_LV_INDICATOR;
|
||||
Reg.BaseOutput.OutputSetup = CBL32_DO_OUTPUT_SETUP_DEFAULT;
|
||||
Reg.BaseOutput.DriverPinIndex = P5_HELPER_MapOutput_CBL_to_Pin(${dix.Pin});
|
||||
Reg.BaseOutput.WelcomeSetup = ${dix.LightOutput.Welcome ? 0x80 : 0x00};
|
||||
Reg.BaseOutput.WelcomeStaff = ${dix.LightOutput.WelcomeStaff ? 0x80 : 0x00};
|
||||
Reg.BaseOutput.WelcomeGuest = ${dix.LightOutput.WelcomeGuest ? 0x80 : 0x00};
|
||||
Reg.BaseOutput.Min_GracePeriodStaff = ${dix.LightOutput.WelcomeStaffDelayMin};
|
||||
Reg.BaseOutput.Min_GracePeriodGuest = ${dix.LightOutput.WelcomeGuestDelayMin};
|
||||
Reg.DimSetup = 0;\n `
|
||||
dix.LightOutput.LogicalCircuitList.forEach((s, index) => {
|
||||
if (s > 0) {
|
||||
code73 += `Reg.LogCircuit[${index}] = ${s};\n `
|
||||
}
|
||||
});
|
||||
dix.LightOutput.SceneList.forEach((s, index) => {
|
||||
if (s.Enable) {
|
||||
code73 += `Reg.SceneLevel[${index<10?' ':''}${index}] = ${s.Enable ? 0x80 : 0x00} + CBL32_LS_LEVEL_PERCENT(${s.Value ? 100 : 0});\n `
|
||||
}
|
||||
});
|
||||
code73 += `APPMAP_RegistryCreate(REG_GRPKEY_LIGHT_OUTPUT, ${dix.Pin}, (BYTE *)&Reg, sizeof(Reg));\n `
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
Object.values(device.VIRTUAL_OUTPUT).forEach((dix) => {
|
||||
if (dix.Func === 'GuideOutput') {
|
||||
code73 += `
|
||||
Reg.BaseOutput.DriverIndex = CBL32_LO_DRIVER_INDEX_LV_INDICATOR;
|
||||
Reg.BaseOutput.OutputSetup = CBL32_DO_OUTPUT_SETUP_DEFAULT;
|
||||
Reg.BaseOutput.DriverPinIndex = P5_HELPER_MapOutput_CBL_to_Pin(${dix.Pin});
|
||||
Reg.BaseOutput.WelcomeSetup = ${dix.LightOutput.Welcome ? 0x80 : 0x00};
|
||||
Reg.BaseOutput.WelcomeStaff = ${dix.LightOutput.WelcomeStaff ? 0x80 : 0x00};
|
||||
Reg.BaseOutput.WelcomeGuest = ${dix.LightOutput.WelcomeGuest ? 0x80 : 0x00};
|
||||
Reg.BaseOutput.Min_GracePeriodStaff = ${dix.LightOutput.WelcomeStaffDelayMin};
|
||||
Reg.BaseOutput.Min_GracePeriodGuest = ${dix.LightOutput.WelcomeGuestDelayMin};
|
||||
Reg.DimSetup = 0;\n `
|
||||
dix.LightOutput.LogicalCircuitList.forEach((s, index) => {
|
||||
if (s > 0) {
|
||||
code73 += `Reg.LogCircuit[${index}] = ${s};\n `
|
||||
}
|
||||
});
|
||||
dix.LightOutput.SceneList.forEach((s, index) => {
|
||||
if (s.Enable) {
|
||||
code73 += `Reg.SceneLevel[${index<10?' ':''}${index}] = ${s.Enable ? 0x80 : 0x00} + CBL32_LS_LEVEL_PERCENT(${s.Value ? 100 : 0});\n `
|
||||
}
|
||||
});
|
||||
code73 += `APPMAP_RegistryCreate(REG_GRPKEY_LIGHT_OUTPUT, ${dix.Pin}, (BYTE *)&Reg, sizeof(Reg));\n `
|
||||
}
|
||||
});
|
||||
code = `//**********************************************************************************************************************
|
||||
// FileName : Personality.c
|
||||
// Author(s) : Philipp Roosli, Michael Sobanko
|
||||
// Description: Template for the personalization of a device.
|
||||
//**********************************************************************************************************************
|
||||
// Version History:
|
||||
// 2011/10/14 Base release.
|
||||
//**********************************************************************************************************************
|
||||
|
||||
#include "string.h"
|
||||
#include "APPMAP_Main.h"
|
||||
#include "Personality.h"
|
||||
|
||||
//**********************************************************************************************************************
|
||||
// 设备型号及地址
|
||||
//**********************************************************************************************************************
|
||||
|
||||
#define APP_ID_DEVICE_TYPE \
|
||||
${ device.MODEL }
|
||||
#define P5_ADDRESS \
|
||||
${ device.ADDR }
|
||||
|
||||
//**********************************************************************************************************************
|
||||
// Constants
|
||||
//**********************************************************************************************************************
|
||||
const char LogicalDeviceIdentifier[] = "X10.r4";
|
||||
|
||||
void RunObject(TYPE_CBL32_OBJECT *ptrObj)
|
||||
{
|
||||
TYPE_REG_ENTRY *RegEntry;
|
||||
TYPE_CBL32_LIGHT_OUTPUT_DATA *LOData;
|
||||
if (ptrObj)
|
||||
{
|
||||
RegEntry = ptrObj->ptrRegEntry;
|
||||
LOData = (TYPE_CBL32_LIGHT_OUTPUT_DATA *)ptrObj->ptrData;
|
||||
switch (RegEntry->RegGroup)
|
||||
{
|
||||
case (REG_GRPKEY_IO >> 8):
|
||||
switch (RegEntry->RegKey)
|
||||
{
|
||||
case (REG_GRPKEY_DIGITAL_INPUT & 0xFF):
|
||||
case (REG_GRPKEY_ANALOG_OUTPUT & 0xFF):
|
||||
CBL_HELPER_DefaultIO_RunObject(ptrObj);
|
||||
break;
|
||||
case (REG_GRPKEY_DIGITAL_OUTPUT & 0xFF):
|
||||
{
|
||||
if (LOData->BOData.DriverCtrlCmd == CBL32_IRAS_CTRL_CMD_SET_VALUE)
|
||||
{
|
||||
switch (RegEntry->RegIdx)
|
||||
{
|
||||
case 1: // Pin 3
|
||||
case 2: // Pin 4
|
||||
case 3: // Pin 5
|
||||
case 4: // Pin 6
|
||||
case 5: // Pin 7
|
||||
case 6: // Pin 8
|
||||
case 7: // Pin 9
|
||||
case 8: // Pin 10
|
||||
// HW_API_02_9593_DigitalOut_Control(P5_HELPER_MapOutput_CBL_to_Pin(RegEntry->RegIdx), (BOOL)LOData->BOData.DriverCtrlValue, BOConfig->DriverConfFlags);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case (REG_GRPKEY_LIGHT_OUTPUT & 0xFF):
|
||||
break;
|
||||
case (REG_GRPKEY_ANALOG_INPUT & 0xFF):
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
void BootRegistry7_1(BYTE IOMAP)
|
||||
{
|
||||
${ code71 }
|
||||
}
|
||||
|
||||
void BootRegistry7_2(BYTE IOMAP)
|
||||
{
|
||||
${ code72 }
|
||||
}
|
||||
|
||||
void BootRegistry7_3(BYTE IOMAP)
|
||||
{
|
||||
TYPE_CBL32REG_7_3_LIGHT_OUTPUT Reg;
|
||||
memcpy(&Reg, (BYTE *)®BOOT_7_3_DEFAULT, sizeof(Reg));
|
||||
${ code73 }
|
||||
}
|
||||
|
||||
void ProcessVFI(TYPE_VFI *VFI)
|
||||
{}
|
||||
|
||||
void ApplicationStartup(void)
|
||||
{
|
||||
BOOL flagBootAppRegistry = TRUE;
|
||||
TYPE_REG_ENTRY *RegEntry = (TYPE_REG_ENTRY *)APPMAP_WRAPPER_BootLoaderSendMsg(CBL32_MSG_REGISTRY_SEARCH_UNIQUE, (REG_GRPKEY_EXT_DEV_NAME << 8), 0);
|
||||
if (RegEntry)
|
||||
{
|
||||
if (strcmp(LogicalDeviceIdentifier, (char *)(RegEntry->RegData)) == 0)
|
||||
{
|
||||
flagBootAppRegistry = FALSE;
|
||||
}
|
||||
}
|
||||
if (flagBootAppRegistry)
|
||||
{
|
||||
BootRegistry(0);
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessP5Reply(BYTE *Data, BYTE DataLen)
|
||||
{}
|
||||
|
||||
void ProcessPAE(BYTE P5Addr, USHORT Param)
|
||||
{}
|
||||
|
||||
void ProcessP5Interceptor(TYPE_CBL32_P5_PRETTY_PACKET *P5PP, ULONG Flags)
|
||||
{}
|
||||
|
||||
ULONG ProcessMsg(ULONG Msg, ULONG P1, ULONG P2)
|
||||
{
|
||||
switch (Msg)
|
||||
{
|
||||
case CBL32_MSG_4MSEC_TICK:
|
||||
break;
|
||||
case CBL32_MSG_32MSEC_TICK:
|
||||
break;
|
||||
case CBL32_MSG_PROCESS_VFI:
|
||||
ProcessVFI((TYPE_VFI *)P1);
|
||||
break;
|
||||
}
|
||||
return (CBL_HELPER_DefaultIO_ProcessMsg(Msg, P1, P2));
|
||||
}
|
||||
|
||||
void ReconfRegistry(BYTE ReconfOp)
|
||||
{}
|
||||
|
||||
void BootRegistry(BYTE IOMAP)
|
||||
{
|
||||
if (IOMAP < 1)
|
||||
{
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_FLAG0, 0x10);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_FLAG1, 0x0F);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_STATION_ADDR, P5_ADDRESS);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_FLAG3, 0x0F);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_MULTICAST_MAP, 0xFF);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_MC_FOCUS_0, 0x00);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_MC_FOCUS_1, 0x00);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_APP_SERVER_0 + 0, 0x00);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_APP_SERVER_0 + 1, 0x00);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_APP_SERVER_0 + 2, 0x00);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_APP_SERVER_0 + 3, 0x00);
|
||||
REG_HELPER_FormatRegistry();
|
||||
}
|
||||
BootRegistry7_1(IOMAP);
|
||||
BootRegistry7_2(IOMAP);
|
||||
BootRegistry7_3(IOMAP);
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_PROPERTY_ID << 8), (const char *)("2.17.3.15"));
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_PART_NO << 8), (const char *)("01-8201.C"));
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_ENGINEER << 8), (const char *)("Greg.Howard@inncom.com"));
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_ENG_MEMO << 8), (const char *)(""));
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_EXT_DEV_NAME << 8), LogicalDeviceIdentifier);
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_INNCONTROL_OPTIONS << 8), (const char *)("Dev_LVIO_2_17_3_15.cfg"));
|
||||
}
|
||||
`
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
|
||||
const iar_code_copy = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(code);
|
||||
ElMessage({
|
||||
message: '已复制',
|
||||
type: 'success',
|
||||
})
|
||||
} catch (err) {
|
||||
console.error('无法复制: ', err);
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.hljs-container {
|
||||
|
||||
|
||||
position: relative;
|
||||
display: block;
|
||||
/* width: 600px; */
|
||||
padding: 30px 5px 2px;
|
||||
overflow-x: hidden;
|
||||
line-height: 20px;
|
||||
text-align: left;
|
||||
background: #21252b;
|
||||
box-shadow: 0 10px 30px 0 rgb(0 0 0 / 40%);
|
||||
}
|
||||
|
||||
/** 3个点 */
|
||||
.hljs-container::before {
|
||||
|
||||
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 15px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
overflow: visible;
|
||||
font-weight: 700;
|
||||
font-size: 16px;
|
||||
line-height: 12px;
|
||||
white-space: nowrap;
|
||||
text-indent: 75px;
|
||||
background-color: #fc625d;
|
||||
border-radius: 16px;
|
||||
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
|
||||
content: attr(codetype);
|
||||
}
|
||||
|
||||
/** 滚动条 */
|
||||
:deep(.hljs) {
|
||||
|
||||
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
:deep(.hljs::-webkit-scrollbar) {
|
||||
|
||||
|
||||
width: 12px !important;
|
||||
height: 12px !important;
|
||||
}
|
||||
|
||||
:deep(.hljs::-webkit-scrollbar-thumb) {
|
||||
|
||||
|
||||
height: 30px !important;
|
||||
background: #d1d8e6;
|
||||
background-clip: content-box;
|
||||
border: 2px solid transparent;
|
||||
border-radius: 19px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
:deep(.hljs::-webkit-scrollbar-thumb:hover) {
|
||||
|
||||
|
||||
background: #a5b3cf;
|
||||
background-clip: content-box;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
:deep(.hljs::-webkit-scrollbar-track-piece) {
|
||||
|
||||
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: #333;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-button {
|
||||
|
||||
|
||||
display: none;
|
||||
}
|
||||
|
||||
/** 复制样式 */
|
||||
.hljs-copy {
|
||||
|
||||
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
right: 30px;
|
||||
display: none;
|
||||
padding: 0 10px;
|
||||
color: #66a9ff;
|
||||
font-size: 10px;
|
||||
background-color: #ecf5ff;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
|
@ -150,28 +150,7 @@
|
|||
import { StarFilled } from "@element-plus/icons-vue";
|
||||
import { ref, reactive } from "vue";
|
||||
const dialogVisible = ref(false);
|
||||
|
||||
|
||||
const di_light_scene = {
|
||||
LightsAllOn_Room: "灯光全开",
|
||||
LightsAllOff_Room: "灯光全关",
|
||||
LightsAllOn_Suite: "套房灯光全开",
|
||||
LightsAllOff_Suite: "套房灯光全关",
|
||||
DimSet: "调光设定",
|
||||
DimToggle: "调光切换",
|
||||
LightCtr: "灯光控制",
|
||||
LightSceneClear: "灯光场景清除",
|
||||
LightSceneSet: "灯光场景设定",
|
||||
SceneClear: "场景清除",
|
||||
SmartCircuitToggle: "智能回路切换",
|
||||
SmartSceneRotate: "智能场景循环",
|
||||
SmartSceneToggle: "智能场景切换",
|
||||
};
|
||||
|
||||
|
||||
const DIGITAL_INPUT_ITEM = {
|
||||
func: 'null',
|
||||
}
|
||||
|
||||
|
||||
const mode = 'BANKMGMTDEF_FLAVOR_AM_X10';
|
||||
const form = reactive({
|
||||
|
|
|
@ -0,0 +1,165 @@
|
|||
//**********************************************************************************************************************
|
||||
// FileName : Personality.c
|
||||
// Author(s) : Philipp Roosli, Michael Sobanko
|
||||
// Description: Template for the personalization of a device.
|
||||
//**********************************************************************************************************************
|
||||
// Version History:
|
||||
// 2011/10/14 Base release.
|
||||
//**********************************************************************************************************************
|
||||
|
||||
#include "string.h"
|
||||
#include "APPMAP_Main.h"
|
||||
#include "Personality.h"
|
||||
|
||||
//**********************************************************************************************************************
|
||||
// 设备型号及地址
|
||||
//**********************************************************************************************************************
|
||||
|
||||
#define APP_ID_DEVICE_TYPE \
|
||||
${ device.MODEL }
|
||||
#define P5_ADDRESS \
|
||||
${ device.ADDR }
|
||||
|
||||
//**********************************************************************************************************************
|
||||
// Constants
|
||||
//**********************************************************************************************************************
|
||||
const char LogicalDeviceIdentifier[] = "X10.r4";
|
||||
|
||||
void RunObject(TYPE_CBL32_OBJECT *ptrObj)
|
||||
{
|
||||
TYPE_REG_ENTRY *RegEntry;
|
||||
TYPE_CBL32_LIGHT_OUTPUT_DATA *LOData;
|
||||
if (ptrObj)
|
||||
{
|
||||
RegEntry = ptrObj->ptrRegEntry;
|
||||
LOData = (TYPE_CBL32_LIGHT_OUTPUT_DATA *)ptrObj->ptrData;
|
||||
switch (RegEntry->RegGroup)
|
||||
{
|
||||
case (REG_GRPKEY_IO >> 8):
|
||||
switch (RegEntry->RegKey)
|
||||
{
|
||||
case (REG_GRPKEY_DIGITAL_INPUT & 0xFF):
|
||||
case (REG_GRPKEY_ANALOG_OUTPUT & 0xFF):
|
||||
CBL_HELPER_DefaultIO_RunObject(ptrObj);
|
||||
break;
|
||||
case (REG_GRPKEY_DIGITAL_OUTPUT & 0xFF):
|
||||
{
|
||||
if (LOData->BOData.DriverCtrlCmd == CBL32_IRAS_CTRL_CMD_SET_VALUE)
|
||||
{
|
||||
switch (RegEntry->RegIdx)
|
||||
{
|
||||
case 1: // Pin 3
|
||||
case 2: // Pin 4
|
||||
case 3: // Pin 5
|
||||
case 4: // Pin 6
|
||||
case 5: // Pin 7
|
||||
case 6: // Pin 8
|
||||
case 7: // Pin 9
|
||||
case 8: // Pin 10
|
||||
// HW_API_02_9593_DigitalOut_Control(P5_HELPER_MapOutput_CBL_to_Pin(RegEntry->RegIdx), (BOOL)LOData->BOData.DriverCtrlValue, BOConfig->DriverConfFlags);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case (REG_GRPKEY_LIGHT_OUTPUT & 0xFF):
|
||||
break;
|
||||
case (REG_GRPKEY_ANALOG_INPUT & 0xFF):
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BootRegistry7_1(BYTE IOMAP)
|
||||
{
|
||||
${ code71 }
|
||||
}
|
||||
|
||||
void BootRegistry7_2(BYTE IOMAP)
|
||||
{
|
||||
${ code72 }
|
||||
}
|
||||
|
||||
void BootRegistry7_3(BYTE IOMAP)
|
||||
{
|
||||
TYPE_CBL32REG_7_3_LIGHT_OUTPUT Reg;
|
||||
memcpy(&Reg, (BYTE *)®BOOT_7_3_DEFAULT, sizeof(Reg));
|
||||
${ code73 }
|
||||
}
|
||||
|
||||
void ProcessVFI(TYPE_VFI *VFI)
|
||||
{}
|
||||
|
||||
void ApplicationStartup(void)
|
||||
{
|
||||
BOOL flagBootAppRegistry = TRUE;
|
||||
TYPE_REG_ENTRY *RegEntry = (TYPE_REG_ENTRY *)APPMAP_WRAPPER_BootLoaderSendMsg(CBL32_MSG_REGISTRY_SEARCH_UNIQUE, (REG_GRPKEY_EXT_DEV_NAME << 8), 0);
|
||||
if (RegEntry)
|
||||
{
|
||||
if (strcmp(LogicalDeviceIdentifier, (char *)(RegEntry->RegData)) == 0)
|
||||
{
|
||||
flagBootAppRegistry = FALSE;
|
||||
}
|
||||
}
|
||||
if (flagBootAppRegistry)
|
||||
{
|
||||
BootRegistry(0);
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessP5Reply(BYTE *Data, BYTE DataLen)
|
||||
{}
|
||||
|
||||
void ProcessPAE(BYTE P5Addr, USHORT Param)
|
||||
{}
|
||||
|
||||
void ProcessP5Interceptor(TYPE_CBL32_P5_PRETTY_PACKET *P5PP, ULONG Flags)
|
||||
{}
|
||||
|
||||
ULONG ProcessMsg(ULONG Msg, ULONG P1, ULONG P2)
|
||||
{
|
||||
switch (Msg)
|
||||
{
|
||||
case CBL32_MSG_4MSEC_TICK:
|
||||
break;
|
||||
case CBL32_MSG_32MSEC_TICK:
|
||||
break;
|
||||
case CBL32_MSG_PROCESS_VFI:
|
||||
ProcessVFI((TYPE_VFI *)P1);
|
||||
break;
|
||||
}
|
||||
return (CBL_HELPER_DefaultIO_ProcessMsg(Msg, P1, P2));
|
||||
}
|
||||
|
||||
void ReconfRegistry(BYTE ReconfOp)
|
||||
{}
|
||||
|
||||
void BootRegistry(BYTE IOMAP)
|
||||
{
|
||||
if (IOMAP < 1)
|
||||
{
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_FLAG0, 0x10);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_FLAG1, 0x0F);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_STATION_ADDR, P5_ADDRESS);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_FLAG3, 0x0F);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_MULTICAST_MAP, 0xFF);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_MC_FOCUS_0, 0x00);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_MC_FOCUS_1, 0x00);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_APP_SERVER_0 + 0, 0x00);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_APP_SERVER_0 + 1, 0x00);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_APP_SERVER_0 + 2, 0x00);
|
||||
APPMAP_EEPROM_Write(EEPROM_OFS_STD_NSPB_BLOCK_CACHED_NV + P5STM_NSPB_CACHE_APP_SERVER_0 + 3, 0x00);
|
||||
REG_HELPER_FormatRegistry();
|
||||
}
|
||||
BootRegistry7_1(IOMAP);
|
||||
BootRegistry7_2(IOMAP);
|
||||
BootRegistry7_3(IOMAP);
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_PROPERTY_ID << 8), (const char *)("2.17.3.15"));
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_PART_NO << 8), (const char *)("01-8201.C"));
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_ENGINEER << 8), (const char *)("Greg.Howard@inncom.com"));
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_ENG_MEMO << 8), (const char *)(""));
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_EXT_DEV_NAME << 8), LogicalDeviceIdentifier);
|
||||
APPMAP_RegistryCreateUKey_String((REG_GRPKEY_INNCONTROL_OPTIONS << 8), (const char *)("Dev_LVIO_2_17_3_15.cfg"));
|
||||
}
|
Loading…
Reference in New Issue