Compare commits

...

94 Commits

Author SHA1 Message Date
iioter
c979ba9299 feat: 对接thingspanel 2025-01-13 09:08:33 +08:00
iioter
1cfd9fe6d9 fix: MQTTClient_Connected Event 2025-01-12 20:08:29 +08:00
iioter
c4d3bcd5f6 feat: 北向使用工厂模式 2025-01-11 23:23:33 +08:00
iioter
b5d7508216 feat: 依赖升级 2025-01-08 09:12:11 +08:00
iioter
e00c53439a 添加了设备的Api 2024-11-15 15:55:08 +08:00
iioter
2bc9fcc357 fix: 新增设备后变量页面打开报错 2024-10-10 09:19:51 +08:00
iioter
5ab6c3e190 fix: 变量导入后刷新 2024-08-30 09:10:07 +08:00
iioter
cd98a2e273 16位数据默认用功能码06 2024-08-12 15:06:56 +08:00
iioter
1fb8d8fc4a fix: 批量删除变量页面缓存 2024-07-28 22:05:35 +08:00
iioter
d4c6d1fec8 fix: 别名变量写入值 2024-07-28 22:05:11 +08:00
iioter
3ed405a476 数据库结构文档 2024-07-19 09:43:03 +08:00
iioter
233c23cbb1 数据库添加注释和索引;数据库转移到data文件夹下方便docker挂载卷 2024-07-19 09:23:04 +08:00
iioter
601930fff3 fix: 大小端字节序 2024-07-01 10:21:05 +08:00
iioter
74cb50bf62 fix: 导入配置后报错 2024-06-10 08:41:54 +08:00
iioter
f218dfc738 驱动程序集自动获取不可修改 2024-06-02 16:12:03 +08:00
iioter
71390bc3a6 优化了存储结构 2024-06-01 23:29:31 +08:00
iioter
e0edf777dc 优先从内存查询设备变量,提升查询速度 2024-06-01 21:24:17 +08:00
iioter
b88b2a5083 mqtt离线缓存、通网续传 2024-06-01 09:14:17 +08:00
iioter
e717ef6274 导出、导入增加"触发"字段 2024-06-01 08:58:02 +08:00
iioter
2f8c01adc6 完成了触发字段的逻辑。可用于上升沿、下降沿的监控 2024-06-01 00:11:23 +08:00
iioter
1939989fa4 增加变量"触发"字段 2024-05-31 22:58:58 +08:00
iioter
8817aa0bca da驱动 2024-05-31 22:20:57 +08:00
iioter
3e42f072e5 fix: device and driver 2024-05-28 09:03:30 +08:00
iioter
dfb56687d7 三菱增加批量读取,ReadMultiple和ReadFromCache方法 2024-01-18 14:52:43 +08:00
iioter
d371045e15 fix: 创建组 2024-01-16 09:00:51 +08:00
iioter
6c86b63d06 Demo Tcp驱动连接状态判断 2024-01-08 22:23:19 +08:00
iioter
231534125a 多语言 2024-01-08 22:18:16 +08:00
Sam
cd7352ee6f
Merge pull request #45 from AbdalaMask/master
Add PLC LSIS
2024-01-08 20:50:27 +08:00
AbdalaMask
56f965ec76
Merge branch 'iioter:master' into master 2024-01-03 06:24:57 +02:00
iioter
a531ae3359 Merge branch 'master' of https://gitee.com/iioter/iotgateway 2024-01-02 16:52:52 +08:00
jimojiangdahu
2aeac021c6
优化系统启动速度 (#46) 2024-01-02 16:50:38 +08:00
Sam
ad2a17e803
!8 修正modbus浮点型数值写入
Merge pull request !8 from 卡卡罗特/master
2024-01-02 08:49:29 +00:00
zhanghuang515
8bd2d3fbaa 修正modbus浮点型数值写入 2024-01-02 14:38:48 +08:00
AbdalaMask
862a6ecacc
Merge branch 'iioter:master' into master 2023-12-26 07:01:58 +02:00
iioter
949e8ea805 modbus 大小端写入 2023-12-25 16:33:34 +08:00
UserX
b1628b1339 Add DeviceXGK 2023-12-23 14:15:55 +02:00
UserX
2109fd644a Translate IoTGateway 2023-12-23 13:23:22 +02:00
UserX
c09dc77fdd Translate IoTGateway.Model 2023-12-23 11:34:58 +02:00
UserX
28c58d9700 fix mqtt 2023-12-21 22:38:54 +02:00
UserX
eb7ac0eff1 fix StartClientAsync 2023-12-21 13:36:42 +02:00
iioter
3c3dcfcfad 尝试提高页面打开速度 2023-12-01 21:24:58 +08:00
iioter
9206daea40 登入页不再默认填入用户名和密码 2023-11-10 08:56:16 +08:00
iioter
88382b7663 ServeUnknownFileTypes 2023-11-09 19:33:51 +08:00
iioter
a4327735c0 优化dockerfile 2023-11-09 13:48:04 +08:00
iioter
caf348a38b 完善modbus协议连读 2023-11-09 13:35:20 +08:00
iioter
78c1314627 优化采集线程 2023-11-09 13:35:07 +08:00
iioter
080994aab8 去掉quote 2023-11-09 13:34:37 +08:00
iioter
36c8942609 驱动归档 2023-11-09 13:34:07 +08:00
iioter
64e950c52b 设备线程内使用ManualResetEvent 2023-10-21 22:14:18 +08:00
iioter
4152b8c598 自动拷贝数据库和ua xml 2023-10-21 22:13:42 +08:00
iioter
68f217fa3f 并行启动采集线程 2023-10-21 22:13:01 +08:00
iioter
e9ee682f37 并行加载驱动 2023-10-21 22:12:40 +08:00
iioter
da79a78da7 1.解决了表达式可能不生效的问题 2.缓存最近3次值,可以用raw、$pv、$ppv获取 3.bool类型的值可以表达式可以直接使用 2023-10-18 10:26:40 +08:00
iioter
22d11eee84 升级依赖 2023-10-18 10:21:06 +08:00
iioter
99cb6d9824 增加double类型解析 2023-07-24 10:38:25 +08:00
iioter
3c953cbdbe Tesla引荐 2023-07-07 10:20:53 +08:00
iioter
cc31812695 客户端属性、共享属性上传 2023-06-29 14:03:38 +08:00
iioter
ac3ac0c6d2 优化dockerfile和脚本 2023-05-24 22:39:19 +08:00
iioter
50562e1fc4 增加西门子gb2312字符串读写 2023-05-24 22:39:02 +08:00
iioter
1393c3106b 批量修改变量的表达式 2023-05-21 21:54:08 +08:00
iioter
c73257d18a opc依赖版本修改 2023-05-18 13:41:45 +08:00
Sam
e2af6d57b7
!6 ADD 达梦数据库适配。
Merge pull request !6 from Peng Sir/master
2023-05-18 04:35:13 +00:00
iioter
1b51a65274 注释 2023-05-18 12:12:36 +08:00
iioter
05a19473ea 基础设备api:设备列表查询 2023-05-17 22:58:39 +08:00
iioter
1abcce164f 开放swagger 2023-05-17 22:57:56 +08:00
彭俊
332a8a7508 ADD 达梦数据库适配。 2023-05-17 13:55:35 +08:00
iioter
e8c13b7245 增加iotgateway平台规则,继承iotsharp ,增加了内置的_ts_遥测 2023-05-06 22:12:26 +08:00
iioter
803f35d01c 1.变量权限增加"只写"类型
2."只读"类型的权限会在写入请求时拒绝
3.开放了通讯配置的"属性侧"和字段名称修改权限
2023-05-06 15:20:08 +08:00
iioter
1e11ba2ef9 驱动加载日志等级 2023-05-05 15:32:37 +08:00
iioter
56e4a0377a fanuc 2023-04-27 12:04:09 +08:00
iioter
0dff56170d 2.0 版本归档 2023-04-23 15:02:06 +08:00
iioter
5c78bb5b95 remove old angular frontend 2023-04-16 10:18:10 +08:00
iioter
359561cac4 merge branch 'private'. this is version 2.0 2023-04-12 23:40:00 +08:00
谷草`
6cdac03ef4
fix: IotSharp RPC response topic error. (#38) 2023-02-15 08:42:29 +08:00
iioter
bfd22acad1 更新文档 2023-02-10 09:54:21 +08:00
iioter
f908d84cf5 线上模版 2023-01-13 16:56:24 +08:00
iioter
391832925a 线上导出的配置 2023-01-12 20:43:38 +08:00
iioter
9908415d43 da默认关闭启动 2023-01-12 14:33:58 +08:00
iioter
b639144e50 驱动归档 2023-01-12 14:14:17 +08:00
iioter
c6659887da Merge branch 'master' of https://github.com/iioter/iotgateway 2023-01-12 14:09:49 +08:00
iioter
ac5180e6cb 1.0.1发版准备 2023-01-12 14:09:05 +08:00
BenjaminChenGH
818ecdd2f9
OPCDA订阅传出的列表中NAME错误修正。 (#36) 2022-12-13 10:27:01 +08:00
iioter
29f022754d 滚动日志 2022-12-12 09:14:42 +08:00
iioter
004717e950 增加变量大小端 2022-12-06 22:39:28 +08:00
iioter
21a8498adf EFCore依赖库改为6.0.10 2022-12-06 22:39:12 +08:00
iioter
4d9c1c52ef 删除rpc日志 2022-12-06 22:38:39 +08:00
MysticBoy
b5e3afe40d
ModBus 优化和大小端 (#35)
* 1. 使用枚举直接对比性能更好。
2. 初步加入大小端转换

* 忽略本地sqlite文件等。

* 修改大小端
2022-12-06 16:01:32 +08:00
iioter
adb20fdae0 fix:MqttClientId 2022-11-27 13:32:29 +08:00
iioter
c7a74b4d48 README.md 2022-11-21 10:01:07 +08:00
iioter
95a9ef5b50 验证了OpcDa 2022-11-21 09:45:18 +08:00
iioter
e924fc8bf5 驱动归档 2022-11-21 09:45:06 +08:00
iioter
2ee5b8c7bd fix:tb不支持qos2可能导致的问题 2022-11-12 16:44:26 +08:00
iioter
dd1f802390 解决thingsboard PubAck问题 2022-11-09 09:48:54 +08:00
iioter
649da528c0 升级依赖 2022-11-09 09:48:28 +08:00
510 changed files with 70975 additions and 65930 deletions

4
.gitignore vendored
View File

@ -17,4 +17,6 @@ bin-release/
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.
/.vs
/IoTGateway/wwwroot/3d
/IoTGateway/wwwroot/3d
/IoTGateway/iotgateway.db-wal
/IoTGateway/iotgateway.db-shm

282
3d/3d.html Normal file
View File

@ -0,0 +1,282 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>3D</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link type="text/css" rel="stylesheet" href="./css/main.css">
<style>
body {
background-color: #bfe3dd;
color: #000;
}
a {
color: #2983ff;
}
</style>
</head>
<body>
<div id="container"></div>
<script src="../jquery.min.js"></script>
<script src="../mqtt.min.js"></script>
<script type="module">
import * as THREE from './lib/three.module.js';
import Stats from './lib/stats.module.js';
import { OrbitControls } from './lib/OrbitControls.js';
import { RoomEnvironment } from './lib/RoomEnvironment.js';
import { GLTFLoader } from './lib/GLTFLoader.js';
import { DRACOLoader } from './lib/DRACOLoader.js';
import { CSS3DObject, CSS3DRenderer } from './lib/CSS3DRenderer.js';
let W = window.innerWidth;
let H = window.innerHeight;
let mixer;
let labelArr = [];
//标签数据
let modelData = [{
id: 1,
cname: "Modbus设备",
ename: "modbus_01",
position: {
x: -0.5,
y: 0.6,
z: 1.55,
},
param: [{
name: "温度",
value: 123,
},
{
name: "湿度",
value: 123,
},
],
}
];
//定时更新数据
//setInterval(() => {
// modelData.forEach((item) => {
// if (item.id > 0) {
// item.param[0].value = parseInt(Math.random() * 30 + 150).toFixed(0);
// item.param[1].value = parseInt(Math.random() * 30 + 150).toFixed(0);
// }
// });
// updateData();
//}, 2000);
inimqttclient();
const clock = new THREE.Clock();
const container = document.getElementById('container');
const stats = new Stats();
container.appendChild(stats.dom);
const css3dRenderer = new CSS3DRenderer();
css3dRenderer.setSize(W, H);
css3dRenderer.domElement.style.position = 'absolute';
css3dRenderer.domElement.style.top = 0;
container.appendChild(css3dRenderer.domElement);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.outputEncoding = THREE.sRGBEncoding;
container.appendChild(renderer.domElement);
const pmremGenerator = new THREE.PMREMGenerator(renderer);
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xbfe3dd);
scene.environment = pmremGenerator.fromScene(new RoomEnvironment(), 0.04).texture;
const camera = new THREE.PerspectiveCamera(40, W / H, .1, 10000);
camera.position.set(5, 2, 8);
const controls = new OrbitControls(camera, container);
controls.target.set(0, 0.5, 0);
controls.update();
controls.enablePan = false;
controls.enableDamping = true;
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath('./lib/gltf/');
const loader = new GLTFLoader();
loader.setDRACOLoader(dracoLoader);
loader.load('./model/LittlestTokyo.glb', function (gltf) {
const model = gltf.scene;
model.position.set(1, 1, 0);
model.scale.set(0.01, 0.01, 0.01);
scene.add(model);
createLableArr();
mixer = new THREE.AnimationMixer(model);
mixer.clipAction(gltf.animations[0]).play();
animate();
}, undefined, function (e) {
console.error(e);
});
//创建标签
function createLableArr() {
let style = "color: #00CED1;cursor:pointer;font-size:30px;padding:5px 15px;"; //background:#43bafe;
modelData.forEach((item) => {
let label = createLabel(item.cname, style, item.param);
label.position.set(item.position.x, item.position.y, item.position.z);
let scale = 0.003;
label.scale.set(scale, scale, scale); //缩放比例
label.name = item.ename;
//label.visible = true;
scene.add(label);
labelArr.push(label);
const axesHelper = new THREE.AxesHelper(5);
label.add(axesHelper);
});
}
/**销毁模型*/
function destroyObject(object) {
if (!object) return;
object.traverse((item) => {
if (item.material) {
if (Array.isArray(item.material)) {
item.material.forEach(m => m.dispose());
} else {
item.material.dispose();
}
}
if (item.geometry) item.geometry.dispose();
item = null;
});
scene.remove(object);
object = null;
}
/**信息标注的生成*/
function createLabel(text, style, param) {
//创建CSS3D
let div_label = document.createElement("div");
div_label.className = "div-label";
let div_ul = document.createElement("ul");
let div_li = document.createElement("li");
style ? (div_li.style = style) : "";
div_li.textContent = `设备名称:${text}`;
div_ul.appendChild(div_li);
if (param.length) {
param.forEach((item) => {
let param_li = document.createElement("li");
style ? (param_li.style = style) : "";
param_li.textContent = `${item.name}:${item.value}`;
div_ul.appendChild(param_li);
});
}
div_label.appendChild(div_ul);
let label = new CSS3DObject(div_label);
return label;
}
//更新数据标签
function updateData() {
if (labelArr.length) {
labelArr.forEach(item => {
destroyObject(item);
});
createLableArr();
}
}
window.onresize = function () {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
};
function animate() {
requestAnimationFrame(animate);
const delta = clock.getDelta();
mixer.update(delta);
controls.update();
//标签
// if (labelArr.length) {
// labelArr.forEach((item) => {
// if (item.visible) {
// item.quaternion.slerp(camera.quaternion, 1);
// }
// });
// }
stats.update();
renderer.render(scene, camera);
css3dRenderer.render(scene, camera);
}
function inimqttclient() {
var options = {
//mqtt客户端的id这里面应该还可以加上其他参数具体看官方文档
clientId: 'mqttjs3d_' + (Math.random() * 10000000).toString()
}
var client = mqtt.connect('ws://' + window.location.host + '/mqtt', options);
client.on('connect', function () {
client.subscribe('internal/v1/gateway/telemetry/+/+', function (err) {
if (!err) {
console.log("订阅成功!")
} else {
console.log(err)
}
})
})
client.on('message', function (topic, message) {
if (topic == 'internal/v1/gateway/telemetry/Modbus/temperature') {
var objmsg = $.parseJSON(message.toString());
modelData[0].param[0].value = objmsg.CookedValue;
updateData();
} else if (topic == 'internal/v1/gateway/telemetry/Modbus/humidity') {
var objmsg = $.parseJSON(message.toString());
modelData[0].param[1].value = objmsg.CookedValue;
updateData();
}
})
}
</script>
</body>
</html>

108
3d/css/main.css Normal file
View File

@ -0,0 +1,108 @@
body {
margin: 0;
background-color: #000;
color: #fff;
font-family: Monospace;
font-size: 13px;
line-height: 24px;
overscroll-behavior: none;
}
a {
color: #ff0;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
button {
cursor: pointer;
text-transform: uppercase;
}
#info {
position: absolute;
top: 0px;
width: 100%;
padding: 10px;
box-sizing: border-box;
text-align: center;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
z-index: 1; /* TODO Solve this in HTML */
}
a, button, input, select {
pointer-events: auto;
}
.lil-gui {
z-index: 2 !important; /* TODO Solve this in HTML */
}
@media all and ( max-width: 640px ) {
.lil-gui.root {
right: auto;
top: auto;
max-height: 50%;
max-width: 80%;
bottom: 0;
left: 0;
}
}
#overlay {
position: absolute;
font-size: 16px;
z-index: 2;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background: rgba(0,0,0,0.7);
}
#overlay button {
background: transparent;
border: 0;
border: 1px solid rgb(255, 255, 255);
border-radius: 4px;
color: #ffffff;
padding: 12px 18px;
text-transform: uppercase;
cursor: pointer;
}
#notSupported {
width: 50%;
margin: auto;
background-color: #f00;
margin-top: 20px;
padding: 10px;
}
.div-label {
width: 355px;
height: 255px;
background: url("../image/info.png") no-repeat;
}
.div-label ul {
margin: 80px 40px;
width: 355px;
height: 255px;
}
.div-label li {
margin: 20px 0;
}

BIN
3d/image/10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
3d/image/info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
3d/image/line.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
3d/image/traffic_01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

308
3d/lib/CSS3DRenderer.js Normal file
View File

@ -0,0 +1,308 @@
import {
Matrix4,
Object3D,
Quaternion,
Vector3
} from './three.module.js';
/**
* Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
*/
const _position = new Vector3();
const _quaternion = new Quaternion();
const _scale = new Vector3();
class CSS3DObject extends Object3D {
constructor( element = document.createElement( 'div' ) ) {
super();
this.element = element;
this.element.style.position = 'absolute';
this.element.style.pointerEvents = 'auto';
this.element.style.userSelect = 'none';
this.element.setAttribute( 'draggable', false );
this.addEventListener( 'removed', function () {
this.traverse( function ( object ) {
if ( object.element instanceof Element && object.element.parentNode !== null ) {
object.element.parentNode.removeChild( object.element );
}
} );
} );
}
copy( source, recursive ) {
super.copy( source, recursive );
this.element = source.element.cloneNode( true );
return this;
}
}
CSS3DObject.prototype.isCSS3DObject = true;
class CSS3DSprite extends CSS3DObject {
constructor( element ) {
super( element );
this.rotation2D = 0;
}
copy( source, recursive ) {
super.copy( source, recursive );
this.rotation2D = source.rotation2D;
return this;
}
}
CSS3DSprite.prototype.isCSS3DSprite = true;
//
const _matrix = new Matrix4();
const _matrix2 = new Matrix4();
class CSS3DRenderer {
constructor( parameters = {} ) {
const _this = this;
let _width, _height;
let _widthHalf, _heightHalf;
const cache = {
camera: { fov: 0, style: '' },
objects: new WeakMap()
};
const domElement = parameters.element !== undefined ? parameters.element : document.createElement( 'div' );
domElement.style.overflow = 'hidden';
this.domElement = domElement;
const cameraElement = document.createElement( 'div' );
cameraElement.style.transformStyle = 'preserve-3d';
cameraElement.style.pointerEvents = 'none';
domElement.appendChild( cameraElement );
this.getSize = function () {
return {
width: _width,
height: _height
};
};
this.render = function ( scene, camera ) {
const fov = camera.projectionMatrix.elements[ 5 ] * _heightHalf;
if ( cache.camera.fov !== fov ) {
domElement.style.perspective = camera.isPerspectiveCamera ? fov + 'px' : '';
cache.camera.fov = fov;
}
if ( scene.autoUpdate === true ) scene.updateMatrixWorld();
if ( camera.parent === null ) camera.updateMatrixWorld();
let tx, ty;
if ( camera.isOrthographicCamera ) {
tx = - ( camera.right + camera.left ) / 2;
ty = ( camera.top + camera.bottom ) / 2;
}
const cameraCSSMatrix = camera.isOrthographicCamera ?
'scale(' + fov + ')' + 'translate(' + epsilon( tx ) + 'px,' + epsilon( ty ) + 'px)' + getCameraCSSMatrix( camera.matrixWorldInverse ) :
'translateZ(' + fov + 'px)' + getCameraCSSMatrix( camera.matrixWorldInverse );
const style = cameraCSSMatrix +
'translate(' + _widthHalf + 'px,' + _heightHalf + 'px)';
if ( cache.camera.style !== style ) {
cameraElement.style.transform = style;
cache.camera.style = style;
}
renderObject( scene, scene, camera, cameraCSSMatrix );
};
this.setSize = function ( width, height ) {
_width = width;
_height = height;
_widthHalf = _width / 2;
_heightHalf = _height / 2;
domElement.style.width = width + 'px';
domElement.style.height = height + 'px';
cameraElement.style.width = width + 'px';
cameraElement.style.height = height + 'px';
};
function epsilon( value ) {
return Math.abs( value ) < 1e-10 ? 0 : value;
}
function getCameraCSSMatrix( matrix ) {
const elements = matrix.elements;
return 'matrix3d(' +
epsilon( elements[ 0 ] ) + ',' +
epsilon( - elements[ 1 ] ) + ',' +
epsilon( elements[ 2 ] ) + ',' +
epsilon( elements[ 3 ] ) + ',' +
epsilon( elements[ 4 ] ) + ',' +
epsilon( - elements[ 5 ] ) + ',' +
epsilon( elements[ 6 ] ) + ',' +
epsilon( elements[ 7 ] ) + ',' +
epsilon( elements[ 8 ] ) + ',' +
epsilon( - elements[ 9 ] ) + ',' +
epsilon( elements[ 10 ] ) + ',' +
epsilon( elements[ 11 ] ) + ',' +
epsilon( elements[ 12 ] ) + ',' +
epsilon( - elements[ 13 ] ) + ',' +
epsilon( elements[ 14 ] ) + ',' +
epsilon( elements[ 15 ] ) +
')';
}
function getObjectCSSMatrix( matrix ) {
const elements = matrix.elements;
const matrix3d = 'matrix3d(' +
epsilon( elements[ 0 ] ) + ',' +
epsilon( elements[ 1 ] ) + ',' +
epsilon( elements[ 2 ] ) + ',' +
epsilon( elements[ 3 ] ) + ',' +
epsilon( - elements[ 4 ] ) + ',' +
epsilon( - elements[ 5 ] ) + ',' +
epsilon( - elements[ 6 ] ) + ',' +
epsilon( - elements[ 7 ] ) + ',' +
epsilon( elements[ 8 ] ) + ',' +
epsilon( elements[ 9 ] ) + ',' +
epsilon( elements[ 10 ] ) + ',' +
epsilon( elements[ 11 ] ) + ',' +
epsilon( elements[ 12 ] ) + ',' +
epsilon( elements[ 13 ] ) + ',' +
epsilon( elements[ 14 ] ) + ',' +
epsilon( elements[ 15 ] ) +
')';
return 'translate(-50%,-50%)' + matrix3d;
}
function renderObject( object, scene, camera, cameraCSSMatrix ) {
if ( object.isCSS3DObject ) {
object.onBeforeRender( _this, scene, camera );
let style;
if ( object.isCSS3DSprite ) {
// http://swiftcoder.wordpress.com/2008/11/25/constructing-a-billboard-matrix/
_matrix.copy( camera.matrixWorldInverse );
_matrix.transpose();
if ( object.rotation2D !== 0 ) _matrix.multiply( _matrix2.makeRotationZ( object.rotation2D ) );
object.matrixWorld.decompose( _position, _quaternion, _scale );
_matrix.setPosition( _position );
_matrix.scale( _scale );
_matrix.elements[ 3 ] = 0;
_matrix.elements[ 7 ] = 0;
_matrix.elements[ 11 ] = 0;
_matrix.elements[ 15 ] = 1;
style = getObjectCSSMatrix( _matrix );
} else {
style = getObjectCSSMatrix( object.matrixWorld );
}
const element = object.element;
const cachedObject = cache.objects.get( object );
if ( cachedObject === undefined || cachedObject.style !== style ) {
element.style.transform = style;
const objectData = { style: style };
cache.objects.set( object, objectData );
}
element.style.display = object.visible ? '' : 'none';
if ( element.parentNode !== cameraElement ) {
cameraElement.appendChild( element );
}
object.onAfterRender( _this, scene, camera );
}
for ( let i = 0, l = object.children.length; i < l; i ++ ) {
renderObject( object.children[ i ], scene, camera, cameraCSSMatrix );
}
}
}
}
export { CSS3DObject, CSS3DSprite, CSS3DRenderer };

587
3d/lib/DRACOLoader.js Normal file
View File

@ -0,0 +1,587 @@
import {
BufferAttribute,
BufferGeometry,
FileLoader,
Loader
} from './three.module.js';
const _taskCache = new WeakMap();
class DRACOLoader extends Loader {
constructor( manager ) {
super( manager );
this.decoderPath = '';
this.decoderConfig = {};
this.decoderBinary = null;
this.decoderPending = null;
this.workerLimit = 4;
this.workerPool = [];
this.workerNextTaskID = 1;
this.workerSourceURL = '';
this.defaultAttributeIDs = {
position: 'POSITION',
normal: 'NORMAL',
color: 'COLOR',
uv: 'TEX_COORD'
};
this.defaultAttributeTypes = {
position: 'Float32Array',
normal: 'Float32Array',
color: 'Float32Array',
uv: 'Float32Array'
};
}
setDecoderPath( path ) {
this.decoderPath = path;
return this;
}
setDecoderConfig( config ) {
this.decoderConfig = config;
return this;
}
setWorkerLimit( workerLimit ) {
this.workerLimit = workerLimit;
return this;
}
load( url, onLoad, onProgress, onError ) {
const loader = new FileLoader( this.manager );
loader.setPath( this.path );
loader.setResponseType( 'arraybuffer' );
loader.setRequestHeader( this.requestHeader );
loader.setWithCredentials( this.withCredentials );
loader.load( url, ( buffer ) => {
const taskConfig = {
attributeIDs: this.defaultAttributeIDs,
attributeTypes: this.defaultAttributeTypes,
useUniqueIDs: false
};
this.decodeGeometry( buffer, taskConfig )
.then( onLoad )
.catch( onError );
}, onProgress, onError );
}
/** @deprecated Kept for backward-compatibility with previous DRACOLoader versions. */
decodeDracoFile( buffer, callback, attributeIDs, attributeTypes ) {
const taskConfig = {
attributeIDs: attributeIDs || this.defaultAttributeIDs,
attributeTypes: attributeTypes || this.defaultAttributeTypes,
useUniqueIDs: !! attributeIDs
};
this.decodeGeometry( buffer, taskConfig ).then( callback );
}
decodeGeometry( buffer, taskConfig ) {
// TODO: For backward-compatibility, support 'attributeTypes' objects containing
// references (rather than names) to typed array constructors. These must be
// serialized before sending them to the worker.
for ( const attribute in taskConfig.attributeTypes ) {
const type = taskConfig.attributeTypes[ attribute ];
if ( type.BYTES_PER_ELEMENT !== undefined ) {
taskConfig.attributeTypes[ attribute ] = type.name;
}
}
//
const taskKey = JSON.stringify( taskConfig );
// Check for an existing task using this buffer. A transferred buffer cannot be transferred
// again from this thread.
if ( _taskCache.has( buffer ) ) {
const cachedTask = _taskCache.get( buffer );
if ( cachedTask.key === taskKey ) {
return cachedTask.promise;
} else if ( buffer.byteLength === 0 ) {
// Technically, it would be possible to wait for the previous task to complete,
// transfer the buffer back, and decode again with the second configuration. That
// is complex, and I don't know of any reason to decode a Draco buffer twice in
// different ways, so this is left unimplemented.
throw new Error(
'THREE.DRACOLoader: Unable to re-decode a buffer with different ' +
'settings. Buffer has already been transferred.'
);
}
}
//
let worker;
const taskID = this.workerNextTaskID ++;
const taskCost = buffer.byteLength;
// Obtain a worker and assign a task, and construct a geometry instance
// when the task completes.
const geometryPending = this._getWorker( taskID, taskCost )
.then( ( _worker ) => {
worker = _worker;
return new Promise( ( resolve, reject ) => {
worker._callbacks[ taskID ] = { resolve, reject };
worker.postMessage( { type: 'decode', id: taskID, taskConfig, buffer }, [ buffer ] );
// this.debug();
} );
} )
.then( ( message ) => this._createGeometry( message.geometry ) );
// Remove task from the task list.
// Note: replaced '.finally()' with '.catch().then()' block - iOS 11 support (#19416)
geometryPending
.catch( () => true )
.then( () => {
if ( worker && taskID ) {
this._releaseTask( worker, taskID );
// this.debug();
}
} );
// Cache the task result.
_taskCache.set( buffer, {
key: taskKey,
promise: geometryPending
} );
return geometryPending;
}
_createGeometry( geometryData ) {
const geometry = new BufferGeometry();
if ( geometryData.index ) {
geometry.setIndex( new BufferAttribute( geometryData.index.array, 1 ) );
}
for ( let i = 0; i < geometryData.attributes.length; i ++ ) {
const attribute = geometryData.attributes[ i ];
const name = attribute.name;
const array = attribute.array;
const itemSize = attribute.itemSize;
geometry.setAttribute( name, new BufferAttribute( array, itemSize ) );
}
return geometry;
}
_loadLibrary( url, responseType ) {
const loader = new FileLoader( this.manager );
loader.setPath( this.decoderPath );
loader.setResponseType( responseType );
loader.setWithCredentials( this.withCredentials );
return new Promise( ( resolve, reject ) => {
loader.load( url, resolve, undefined, reject );
} );
}
preload() {
this._initDecoder();
return this;
}
_initDecoder() {
if ( this.decoderPending ) return this.decoderPending;
const useJS = typeof WebAssembly !== 'object' || this.decoderConfig.type === 'js';
const librariesPending = [];
if ( useJS ) {
librariesPending.push( this._loadLibrary( 'draco_decoder.js', 'text' ) );
} else {
librariesPending.push( this._loadLibrary( 'draco_wasm_wrapper.js', 'text' ) );
librariesPending.push( this._loadLibrary( 'draco_decoder.wasm', 'arraybuffer' ) );
}
this.decoderPending = Promise.all( librariesPending )
.then( ( libraries ) => {
const jsContent = libraries[ 0 ];
if ( ! useJS ) {
this.decoderConfig.wasmBinary = libraries[ 1 ];
}
const fn = DRACOWorker.toString();
const body = [
'/* draco decoder */',
jsContent,
'',
'/* worker */',
fn.substring( fn.indexOf( '{' ) + 1, fn.lastIndexOf( '}' ) )
].join( '\n' );
this.workerSourceURL = URL.createObjectURL( new Blob( [ body ] ) );
} );
return this.decoderPending;
}
_getWorker( taskID, taskCost ) {
return this._initDecoder().then( () => {
if ( this.workerPool.length < this.workerLimit ) {
const worker = new Worker( this.workerSourceURL );
worker._callbacks = {};
worker._taskCosts = {};
worker._taskLoad = 0;
worker.postMessage( { type: 'init', decoderConfig: this.decoderConfig } );
worker.onmessage = function ( e ) {
const message = e.data;
switch ( message.type ) {
case 'decode':
worker._callbacks[ message.id ].resolve( message );
break;
case 'error':
worker._callbacks[ message.id ].reject( message );
break;
default:
console.error( 'THREE.DRACOLoader: Unexpected message, "' + message.type + '"' );
}
};
this.workerPool.push( worker );
} else {
this.workerPool.sort( function ( a, b ) {
return a._taskLoad > b._taskLoad ? - 1 : 1;
} );
}
const worker = this.workerPool[ this.workerPool.length - 1 ];
worker._taskCosts[ taskID ] = taskCost;
worker._taskLoad += taskCost;
return worker;
} );
}
_releaseTask( worker, taskID ) {
worker._taskLoad -= worker._taskCosts[ taskID ];
delete worker._callbacks[ taskID ];
delete worker._taskCosts[ taskID ];
}
debug() {
console.log( 'Task load: ', this.workerPool.map( ( worker ) => worker._taskLoad ) );
}
dispose() {
for ( let i = 0; i < this.workerPool.length; ++ i ) {
this.workerPool[ i ].terminate();
}
this.workerPool.length = 0;
return this;
}
}
/* WEB WORKER */
function DRACOWorker() {
let decoderConfig;
let decoderPending;
onmessage = function ( e ) {
const message = e.data;
switch ( message.type ) {
case 'init':
decoderConfig = message.decoderConfig;
decoderPending = new Promise( function ( resolve/*, reject*/ ) {
decoderConfig.onModuleLoaded = function ( draco ) {
// Module is Promise-like. Wrap before resolving to avoid loop.
resolve( { draco: draco } );
};
DracoDecoderModule( decoderConfig ); // eslint-disable-line no-undef
} );
break;
case 'decode':
const buffer = message.buffer;
const taskConfig = message.taskConfig;
decoderPending.then( ( module ) => {
const draco = module.draco;
const decoder = new draco.Decoder();
const decoderBuffer = new draco.DecoderBuffer();
decoderBuffer.Init( new Int8Array( buffer ), buffer.byteLength );
try {
const geometry = decodeGeometry( draco, decoder, decoderBuffer, taskConfig );
const buffers = geometry.attributes.map( ( attr ) => attr.array.buffer );
if ( geometry.index ) buffers.push( geometry.index.array.buffer );
self.postMessage( { type: 'decode', id: message.id, geometry }, buffers );
} catch ( error ) {
console.error( error );
self.postMessage( { type: 'error', id: message.id, error: error.message } );
} finally {
draco.destroy( decoderBuffer );
draco.destroy( decoder );
}
} );
break;
}
};
function decodeGeometry( draco, decoder, decoderBuffer, taskConfig ) {
const attributeIDs = taskConfig.attributeIDs;
const attributeTypes = taskConfig.attributeTypes;
let dracoGeometry;
let decodingStatus;
const geometryType = decoder.GetEncodedGeometryType( decoderBuffer );
if ( geometryType === draco.TRIANGULAR_MESH ) {
dracoGeometry = new draco.Mesh();
decodingStatus = decoder.DecodeBufferToMesh( decoderBuffer, dracoGeometry );
} else if ( geometryType === draco.POINT_CLOUD ) {
dracoGeometry = new draco.PointCloud();
decodingStatus = decoder.DecodeBufferToPointCloud( decoderBuffer, dracoGeometry );
} else {
throw new Error( 'THREE.DRACOLoader: Unexpected geometry type.' );
}
if ( ! decodingStatus.ok() || dracoGeometry.ptr === 0 ) {
throw new Error( 'THREE.DRACOLoader: Decoding failed: ' + decodingStatus.error_msg() );
}
const geometry = { index: null, attributes: [] };
// Gather all vertex attributes.
for ( const attributeName in attributeIDs ) {
const attributeType = self[ attributeTypes[ attributeName ] ];
let attribute;
let attributeID;
// A Draco file may be created with default vertex attributes, whose attribute IDs
// are mapped 1:1 from their semantic name (POSITION, NORMAL, ...). Alternatively,
// a Draco file may contain a custom set of attributes, identified by known unique
// IDs. glTF files always do the latter, and `.drc` files typically do the former.
if ( taskConfig.useUniqueIDs ) {
attributeID = attributeIDs[ attributeName ];
attribute = decoder.GetAttributeByUniqueId( dracoGeometry, attributeID );
} else {
attributeID = decoder.GetAttributeId( dracoGeometry, draco[ attributeIDs[ attributeName ] ] );
if ( attributeID === - 1 ) continue;
attribute = decoder.GetAttribute( dracoGeometry, attributeID );
}
geometry.attributes.push( decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) );
}
// Add index.
if ( geometryType === draco.TRIANGULAR_MESH ) {
geometry.index = decodeIndex( draco, decoder, dracoGeometry );
}
draco.destroy( dracoGeometry );
return geometry;
}
function decodeIndex( draco, decoder, dracoGeometry ) {
const numFaces = dracoGeometry.num_faces();
const numIndices = numFaces * 3;
const byteLength = numIndices * 4;
const ptr = draco._malloc( byteLength );
decoder.GetTrianglesUInt32Array( dracoGeometry, byteLength, ptr );
const index = new Uint32Array( draco.HEAPF32.buffer, ptr, numIndices ).slice();
draco._free( ptr );
return { array: index, itemSize: 1 };
}
function decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) {
const numComponents = attribute.num_components();
const numPoints = dracoGeometry.num_points();
const numValues = numPoints * numComponents;
const byteLength = numValues * attributeType.BYTES_PER_ELEMENT;
const dataType = getDracoDataType( draco, attributeType );
const ptr = draco._malloc( byteLength );
decoder.GetAttributeDataArrayForAllPoints( dracoGeometry, attribute, dataType, byteLength, ptr );
const array = new attributeType( draco.HEAPF32.buffer, ptr, numValues ).slice();
draco._free( ptr );
return {
name: attributeName,
array: array,
itemSize: numComponents
};
}
function getDracoDataType( draco, attributeType ) {
switch ( attributeType ) {
case Float32Array: return draco.DT_FLOAT32;
case Int8Array: return draco.DT_INT8;
case Int16Array: return draco.DT_INT16;
case Int32Array: return draco.DT_INT32;
case Uint8Array: return draco.DT_UINT8;
case Uint16Array: return draco.DT_UINT16;
case Uint32Array: return draco.DT_UINT32;
}
}
}
export { DRACOLoader };

4349
3d/lib/GLTFLoader.js Normal file

File diff suppressed because it is too large Load Diff

1252
3d/lib/OrbitControls.js Normal file

File diff suppressed because it is too large Load Diff

121
3d/lib/RoomEnvironment.js Normal file
View File

@ -0,0 +1,121 @@
/**
* https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts
*/
import {
BackSide,
BoxGeometry,
Mesh,
MeshBasicMaterial,
MeshStandardMaterial,
PointLight,
Scene,
} from './three.module.js';
class RoomEnvironment extends Scene {
constructor() {
super();
const geometry = new BoxGeometry();
geometry.deleteAttribute( 'uv' );
const roomMaterial = new MeshStandardMaterial( { side: BackSide } );
const boxMaterial = new MeshStandardMaterial();
const mainLight = new PointLight( 0xffffff, 5.0, 28, 2 );
mainLight.position.set( 0.418, 16.199, 0.300 );
this.add( mainLight );
const room = new Mesh( geometry, roomMaterial );
room.position.set( - 0.757, 13.219, 0.717 );
room.scale.set( 31.713, 28.305, 28.591 );
this.add( room );
const box1 = new Mesh( geometry, boxMaterial );
box1.position.set( - 10.906, 2.009, 1.846 );
box1.rotation.set( 0, - 0.195, 0 );
box1.scale.set( 2.328, 7.905, 4.651 );
this.add( box1 );
const box2 = new Mesh( geometry, boxMaterial );
box2.position.set( - 5.607, - 0.754, - 0.758 );
box2.rotation.set( 0, 0.994, 0 );
box2.scale.set( 1.970, 1.534, 3.955 );
this.add( box2 );
const box3 = new Mesh( geometry, boxMaterial );
box3.position.set( 6.167, 0.857, 7.803 );
box3.rotation.set( 0, 0.561, 0 );
box3.scale.set( 3.927, 6.285, 3.687 );
this.add( box3 );
const box4 = new Mesh( geometry, boxMaterial );
box4.position.set( - 2.017, 0.018, 6.124 );
box4.rotation.set( 0, 0.333, 0 );
box4.scale.set( 2.002, 4.566, 2.064 );
this.add( box4 );
const box5 = new Mesh( geometry, boxMaterial );
box5.position.set( 2.291, - 0.756, - 2.621 );
box5.rotation.set( 0, - 0.286, 0 );
box5.scale.set( 1.546, 1.552, 1.496 );
this.add( box5 );
const box6 = new Mesh( geometry, boxMaterial );
box6.position.set( - 2.193, - 0.369, - 5.547 );
box6.rotation.set( 0, 0.516, 0 );
box6.scale.set( 3.875, 3.487, 2.986 );
this.add( box6 );
// -x right
const light1 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
light1.position.set( - 16.116, 14.37, 8.208 );
light1.scale.set( 0.1, 2.428, 2.739 );
this.add( light1 );
// -x left
const light2 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
light2.position.set( - 16.109, 18.021, - 8.207 );
light2.scale.set( 0.1, 2.425, 2.751 );
this.add( light2 );
// +x
const light3 = new Mesh( geometry, createAreaLightMaterial( 17 ) );
light3.position.set( 14.904, 12.198, - 1.832 );
light3.scale.set( 0.15, 4.265, 6.331 );
this.add( light3 );
// +z
const light4 = new Mesh( geometry, createAreaLightMaterial( 43 ) );
light4.position.set( - 0.462, 8.89, 14.520 );
light4.scale.set( 4.38, 5.441, 0.088 );
this.add( light4 );
// -z
const light5 = new Mesh( geometry, createAreaLightMaterial( 20 ) );
light5.position.set( 3.235, 11.486, - 12.541 );
light5.scale.set( 2.5, 2.0, 0.1 );
this.add( light5 );
// +y
const light6 = new Mesh( geometry, createAreaLightMaterial( 100 ) );
light6.position.set( 0.0, 20.0, 0.0 );
light6.scale.set( 1.0, 0.1, 1.0 );
this.add( light6 );
}
}
function createAreaLightMaterial( intensity ) {
const material = new MeshBasicMaterial();
material.color.setScalar( intensity );
return material;
}
export { RoomEnvironment };

63
3d/lib/ShaderPass.js Normal file
View File

@ -0,0 +1,63 @@
( function () {
class ShaderPass extends THREE.Pass {
constructor( shader, textureID ) {
super();
this.textureID = textureID !== undefined ? textureID : 'tDiffuse';
if ( shader instanceof THREE.ShaderMaterial ) {
this.uniforms = shader.uniforms;
this.material = shader;
} else if ( shader ) {
this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
this.material = new THREE.ShaderMaterial( {
defines: Object.assign( {}, shader.defines ),
uniforms: this.uniforms,
vertexShader: shader.vertexShader,
fragmentShader: shader.fragmentShader
} );
}
this.fsQuad = new THREE.FullScreenQuad( this.material );
}
render( renderer, writeBuffer, readBuffer
/*, deltaTime, maskActive */
) {
if ( this.uniforms[ this.textureID ] ) {
this.uniforms[ this.textureID ].value = readBuffer.texture;
}
this.fsQuad.material = this.material;
if ( this.renderToScreen ) {
renderer.setRenderTarget( null );
this.fsQuad.render( renderer );
} else {
renderer.setRenderTarget( writeBuffer ); // TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600
if ( this.clear ) renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );
this.fsQuad.render( renderer );
}
}
}
THREE.ShaderPass = ShaderPass;
} )();

14
3d/lib/dat.gui.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,104 @@
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(f){var m=0;return function(){return m<f.length?{done:!1,value:f[m++]}:{done:!0}}};$jscomp.arrayIterator=function(f){return{next:$jscomp.arrayIteratorImpl(f)}};$jscomp.makeIterator=function(f){var m="undefined"!=typeof Symbol&&Symbol.iterator&&f[Symbol.iterator];return m?m.call(f):$jscomp.arrayIterator(f)};
$jscomp.getGlobal=function(f){return"undefined"!=typeof window&&window===f?f:"undefined"!=typeof global&&null!=global?global:f};$jscomp.global=$jscomp.getGlobal(this);$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(f,m,v){f!=Array.prototype&&f!=Object.prototype&&(f[m]=v.value)};
$jscomp.polyfill=function(f,m,v,t){if(m){v=$jscomp.global;f=f.split(".");for(t=0;t<f.length-1;t++){var h=f[t];h in v||(v[h]={});v=v[h]}f=f[f.length-1];t=v[f];m=m(t);m!=t&&null!=m&&$jscomp.defineProperty(v,f,{configurable:!0,writable:!0,value:m})}};$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(f){function m(){this.batch_=null}function v(e){return e instanceof h?e:new h(function(l,f){l(e)})}if(f&&!$jscomp.FORCE_POLYFILL_PROMISE)return f;m.prototype.asyncExecute=function(e){if(null==this.batch_){this.batch_=[];var l=this;this.asyncExecuteFunction(function(){l.executeBatch_()})}this.batch_.push(e)};var t=$jscomp.global.setTimeout;m.prototype.asyncExecuteFunction=function(e){t(e,0)};m.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var e=
this.batch_;this.batch_=[];for(var l=0;l<e.length;++l){var f=e[l];e[l]=null;try{f()}catch(z){this.asyncThrow_(z)}}}this.batch_=null};m.prototype.asyncThrow_=function(e){this.asyncExecuteFunction(function(){throw e;})};var h=function(e){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var l=this.createResolveAndReject_();try{e(l.resolve,l.reject)}catch(S){l.reject(S)}};h.prototype.createResolveAndReject_=function(){function e(e){return function(h){f||(f=!0,e.call(l,h))}}var l=this,f=!1;
return{resolve:e(this.resolveTo_),reject:e(this.reject_)}};h.prototype.resolveTo_=function(e){if(e===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof h)this.settleSameAsPromise_(e);else{a:switch(typeof e){case "object":var l=null!=e;break a;case "function":l=!0;break a;default:l=!1}l?this.resolveToNonPromiseObj_(e):this.fulfill_(e)}};h.prototype.resolveToNonPromiseObj_=function(e){var l=void 0;try{l=e.then}catch(S){this.reject_(S);return}"function"==typeof l?
this.settleSameAsThenable_(l,e):this.fulfill_(e)};h.prototype.reject_=function(e){this.settle_(2,e)};h.prototype.fulfill_=function(e){this.settle_(1,e)};h.prototype.settle_=function(e,l){if(0!=this.state_)throw Error("Cannot settle("+e+", "+l+"): Promise already settled in state"+this.state_);this.state_=e;this.result_=l;this.executeOnSettledCallbacks_()};h.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var e=0;e<this.onSettledCallbacks_.length;++e)X.asyncExecute(this.onSettledCallbacks_[e]);
this.onSettledCallbacks_=null}};var X=new m;h.prototype.settleSameAsPromise_=function(e){var l=this.createResolveAndReject_();e.callWhenSettled_(l.resolve,l.reject)};h.prototype.settleSameAsThenable_=function(e,l){var f=this.createResolveAndReject_();try{e.call(l,f.resolve,f.reject)}catch(z){f.reject(z)}};h.prototype.then=function(e,f){function l(e,f){return"function"==typeof e?function(f){try{m(e(f))}catch(p){v(p)}}:f}var m,v,t=new h(function(e,f){m=e;v=f});this.callWhenSettled_(l(e,m),l(f,v));return t};
h.prototype.catch=function(e){return this.then(void 0,e)};h.prototype.callWhenSettled_=function(e,f){function l(){switch(h.state_){case 1:e(h.result_);break;case 2:f(h.result_);break;default:throw Error("Unexpected state: "+h.state_);}}var h=this;null==this.onSettledCallbacks_?X.asyncExecute(l):this.onSettledCallbacks_.push(l)};h.resolve=v;h.reject=function(e){return new h(function(f,h){h(e)})};h.race=function(e){return new h(function(f,h){for(var l=$jscomp.makeIterator(e),m=l.next();!m.done;m=l.next())v(m.value).callWhenSettled_(f,
h)})};h.all=function(e){var f=$jscomp.makeIterator(e),m=f.next();return m.done?v([]):new h(function(e,h){function l(f){return function(h){t[f]=h;z--;0==z&&e(t)}}var t=[],z=0;do t.push(void 0),z++,v(m.value).callWhenSettled_(l(t.length-1),h),m=f.next();while(!m.done)})};return h},"es6","es3");
var DracoDecoderModule=function(){var f="undefined"!==typeof document&&document.currentScript?document.currentScript.src:void 0;"undefined"!==typeof __filename&&(f=f||__filename);return function(m){function v(k){return a.locateFile?a.locateFile(k,M):M+k}function t(a,c){a||z("Assertion failed: "+c)}function h(a,c,b){var d=c+b;for(b=c;a[b]&&!(b>=d);)++b;if(16<b-c&&a.subarray&&xa)return xa.decode(a.subarray(c,b));for(d="";c<b;){var k=a[c++];if(k&128){var e=a[c++]&63;if(192==(k&224))d+=String.fromCharCode((k&
31)<<6|e);else{var f=a[c++]&63;k=224==(k&240)?(k&15)<<12|e<<6|f:(k&7)<<18|e<<12|f<<6|a[c++]&63;65536>k?d+=String.fromCharCode(k):(k-=65536,d+=String.fromCharCode(55296|k>>10,56320|k&1023))}}else d+=String.fromCharCode(k)}return d}function X(a,c){return a?h(ca,a,c):""}function e(a,c){0<a%c&&(a+=c-a%c);return a}function l(k){ka=k;a.HEAP8=T=new Int8Array(k);a.HEAP16=new Int16Array(k);a.HEAP32=P=new Int32Array(k);a.HEAPU8=ca=new Uint8Array(k);a.HEAPU16=new Uint16Array(k);a.HEAPU32=new Uint32Array(k);
a.HEAPF32=new Float32Array(k);a.HEAPF64=new Float64Array(k)}function S(k){for(;0<k.length;){var c=k.shift();if("function"==typeof c)c();else{var b=c.func;"number"===typeof b?void 0===c.arg?a.dynCall_v(b):a.dynCall_vi(b,c.arg):b(void 0===c.arg?null:c.arg)}}}function z(k){if(a.onAbort)a.onAbort(k);k+="";ya(k);Y(k);za=!0;throw new WebAssembly.RuntimeError("abort("+k+"). Build with -s ASSERTIONS=1 for more info.");}function va(a){return String.prototype.startsWith?a.startsWith("data:application/octet-stream;base64,"):
0===a.indexOf("data:application/octet-stream;base64,")}function wa(){try{if(da)return new Uint8Array(da);if(la)return la(U);throw"both async and sync fetching of the wasm failed";}catch(k){z(k)}}function Ma(){return da||!ea&&!Z||"function"!==typeof fetch?new Promise(function(a,c){a(wa())}):fetch(U,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+U+"'";return a.arrayBuffer()}).catch(function(){return wa()})}function ba(){if(!ba.strings){var a={USER:"web_user",
LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:na},c;for(c in Aa)a[c]=Aa[c];var b=[];for(c in a)b.push(c+"="+a[c]);ba.strings=b}return ba.strings}function ma(k){function c(){if(!fa&&(fa=!0,!za)){Ba=!0;S(Ca);S(Da);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Ea.unshift(a.postRun.shift());
S(Ea)}}if(!(0<aa)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Fa.unshift(a.preRun.shift());S(Fa);0<aa||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);c()},1)):c())}}function p(){}function u(a){return(a||p).__cache__}function N(a,c){var b=u(c),d=b[a];if(d)return d;d=Object.create((c||p).prototype);d.ptr=a;return b[a]=d}function V(a){if("string"===typeof a){for(var c=0,b=0;b<a.length;++b){var d=a.charCodeAt(b);
55296<=d&&57343>=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++b)&1023);127>=d?++c:c=2047>=d?c+2:65535>=d?c+3:c+4}c=Array(c+1);b=0;d=c.length;if(0<d){d=b+d-1;for(var k=0;k<a.length;++k){var e=a.charCodeAt(k);if(55296<=e&&57343>=e){var f=a.charCodeAt(++k);e=65536+((e&1023)<<10)|f&1023}if(127>=e){if(b>=d)break;c[b++]=e}else{if(2047>=e){if(b+1>=d)break;c[b++]=192|e>>6}else{if(65535>=e){if(b+2>=d)break;c[b++]=224|e>>12}else{if(b+3>=d)break;c[b++]=240|e>>18;c[b++]=128|e>>12&63}c[b++]=128|e>>6&63}c[b++]=128|
e&63}}c[b]=0}a=n.alloc(c,T);n.copy(c,T,a)}return a}function x(){throw"cannot construct a Status, no constructor in IDL";}function A(){this.ptr=Oa();u(A)[this.ptr]=this}function B(){this.ptr=Pa();u(B)[this.ptr]=this}function C(){this.ptr=Qa();u(C)[this.ptr]=this}function D(){this.ptr=Ra();u(D)[this.ptr]=this}function E(){this.ptr=Sa();u(E)[this.ptr]=this}function q(){this.ptr=Ta();u(q)[this.ptr]=this}function J(){this.ptr=Ua();u(J)[this.ptr]=this}function w(){this.ptr=Va();u(w)[this.ptr]=this}function F(){this.ptr=
Wa();u(F)[this.ptr]=this}function r(){this.ptr=Xa();u(r)[this.ptr]=this}function G(){this.ptr=Ya();u(G)[this.ptr]=this}function H(){this.ptr=Za();u(H)[this.ptr]=this}function O(){this.ptr=$a();u(O)[this.ptr]=this}function K(){this.ptr=ab();u(K)[this.ptr]=this}function g(){this.ptr=bb();u(g)[this.ptr]=this}function y(){this.ptr=cb();u(y)[this.ptr]=this}function Q(){throw"cannot construct a VoidPtr, no constructor in IDL";}function I(){this.ptr=db();u(I)[this.ptr]=this}function L(){this.ptr=eb();u(L)[this.ptr]=
this}m=m||{};var a="undefined"!==typeof m?m:{},Ga=!1,Ha=!1;a.onRuntimeInitialized=function(){Ga=!0;if(Ha&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ha=!0;if(Ga&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3<a.length?!1:1==a[0]&&0<=a[1]&&3>=a[1]?!0:0!=a[0]||10<a[1]?!1:!0};var ha={},W;for(W in a)a.hasOwnProperty(W)&&(ha[W]=a[W]);var na="./this.program",
ea=!1,Z=!1,oa=!1,fb=!1,Ia=!1;ea="object"===typeof window;Z="function"===typeof importScripts;oa=(fb="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)&&!ea&&!Z;Ia=!ea&&!oa&&!Z;var M="",pa,qa;if(oa){M=__dirname+"/";var ra=function(a,c){pa||(pa=require("fs"));qa||(qa=require("path"));a=qa.normalize(a);return pa.readFileSync(a,c?null:"utf8")};var la=function(a){a=ra(a,!0);a.buffer||(a=new Uint8Array(a));t(a.buffer);return a};1<process.argv.length&&
(na=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);process.on("uncaughtException",function(a){throw a;});process.on("unhandledRejection",z);a.inspect=function(){return"[Emscripten Module object]"}}else if(Ia)"undefined"!=typeof read&&(ra=function(a){return read(a)}),la=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");t("object"===typeof a);return a},"undefined"!==typeof print&&("undefined"===typeof console&&(console={}),console.log=print,
console.warn=console.error="undefined"!==typeof printErr?printErr:print);else if(ea||Z)Z?M=self.location.href:document.currentScript&&(M=document.currentScript.src),f&&(M=f),M=0!==M.indexOf("blob:")?M.substr(0,M.lastIndexOf("/")+1):"",ra=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);return c.responseText},Z&&(la=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)});var ya=a.print||console.log.bind(console),
Y=a.printErr||console.warn.bind(console);for(W in ha)ha.hasOwnProperty(W)&&(a[W]=ha[W]);ha=null;a.thisProgram&&(na=a.thisProgram);var da;a.wasmBinary&&(da=a.wasmBinary);"object"!==typeof WebAssembly&&Y("no native wasm support detected");var ia,gb=new WebAssembly.Table({initial:293,maximum:293,element:"anyfunc"}),za=!1,xa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");var T,ca,P,Ja=a.TOTAL_MEMORY||16777216;if(ia=a.wasmMemory?
a.wasmMemory:new WebAssembly.Memory({initial:Ja/65536}))var ka=ia.buffer;Ja=ka.byteLength;l(ka);P[3416]=5256704;var Fa=[],Ca=[],Da=[],Ea=[],Ba=!1,aa=0,sa=null,ja=null;a.preloadedImages={};a.preloadedAudios={};var U="draco_decoder.wasm";va(U)||(U=v(U));Ca.push({func:function(){hb()}});var Aa={},R={buffers:[null,[],[]],printChar:function(a,c){var b=R.buffers[a];0===c||10===c?((1===a?ya:Y)(h(b,0)),b.length=0):b.push(c)},varargs:0,get:function(a){R.varargs+=4;return P[R.varargs-4>>2]},getStr:function(){return X(R.get())},
get64:function(){var a=R.get();R.get();return a},getZero:function(){R.get()}},Ka={__cxa_allocate_exception:function(a){return ib(a)},__cxa_throw:function(a,c,b){"uncaught_exception"in ta?ta.uncaught_exceptions++:ta.uncaught_exceptions=1;throw a;},abort:function(){z()},emscripten_get_sbrk_ptr:function(){return 13664},emscripten_memcpy_big:function(a,c,b){ca.set(ca.subarray(c,c+b),a)},emscripten_resize_heap:function(a){if(2147418112<a)return!1;for(var c=Math.max(T.length,16777216);c<a;)c=536870912>=
c?e(2*c,65536):Math.min(e((3*c+2147483648)/4,65536),2147418112);a:{try{ia.grow(c-ka.byteLength+65535>>16);l(ia.buffer);var b=1;break a}catch(d){}b=void 0}return b?!0:!1},environ_get:function(a,c){var b=0;ba().forEach(function(d,e){var f=c+b;e=P[a+4*e>>2]=f;for(f=0;f<d.length;++f)T[e++>>0]=d.charCodeAt(f);T[e>>0]=0;b+=d.length+1});return 0},environ_sizes_get:function(a,c){var b=ba();P[a>>2]=b.length;var d=0;b.forEach(function(a){d+=a.length+1});P[c>>2]=d;return 0},fd_close:function(a){return 0},fd_seek:function(a,
c,b,d,e){return 0},fd_write:function(a,c,b,d){try{for(var e=0,f=0;f<b;f++){for(var g=P[c+8*f>>2],k=P[c+(8*f+4)>>2],h=0;h<k;h++)R.printChar(a,ca[g+h]);e+=k}P[d>>2]=e;return 0}catch(ua){return"undefined"!==typeof FS&&ua instanceof FS.ErrnoError||z(ua),ua.errno}},memory:ia,setTempRet0:function(a){},table:gb},La=function(){function e(c,b){a.asm=c.exports;aa--;a.monitorRunDependencies&&a.monitorRunDependencies(aa);0==aa&&(null!==sa&&(clearInterval(sa),sa=null),ja&&(c=ja,ja=null,c()))}function c(a){e(a.instance)}
function b(a){return Ma().then(function(a){return WebAssembly.instantiate(a,d)}).then(a,function(a){Y("failed to asynchronously prepare wasm: "+a);z(a)})}var d={env:Ka,wasi_unstable:Ka};aa++;a.monitorRunDependencies&&a.monitorRunDependencies(aa);if(a.instantiateWasm)try{return a.instantiateWasm(d,e)}catch(Na){return Y("Module.instantiateWasm callback failed with error: "+Na),!1}(function(){if(da||"function"!==typeof WebAssembly.instantiateStreaming||va(U)||"function"!==typeof fetch)return b(c);fetch(U,
{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,d).then(c,function(a){Y("wasm streaming compile failed: "+a);Y("falling back to ArrayBuffer instantiation");b(c)})})})();return{}}();a.asm=La;var hb=a.___wasm_call_ctors=function(){return a.asm.__wasm_call_ctors.apply(null,arguments)},jb=a._emscripten_bind_Status_code_0=function(){return a.asm.emscripten_bind_Status_code_0.apply(null,arguments)},kb=a._emscripten_bind_Status_ok_0=function(){return a.asm.emscripten_bind_Status_ok_0.apply(null,
arguments)},lb=a._emscripten_bind_Status_error_msg_0=function(){return a.asm.emscripten_bind_Status_error_msg_0.apply(null,arguments)},mb=a._emscripten_bind_Status___destroy___0=function(){return a.asm.emscripten_bind_Status___destroy___0.apply(null,arguments)},Oa=a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply(null,arguments)},nb=a._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt16Array_GetValue_1.apply(null,
arguments)},ob=a._emscripten_bind_DracoUInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_size_0.apply(null,arguments)},pb=a._emscripten_bind_DracoUInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt16Array___destroy___0.apply(null,arguments)},Pa=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm.emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},qb=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm.emscripten_bind_PointCloud_num_attributes_0.apply(null,
arguments)},rb=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm.emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},sb=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm.emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Qa=a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply(null,arguments)},tb=a._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt8Array_GetValue_1.apply(null,
arguments)},ub=a._emscripten_bind_DracoUInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_size_0.apply(null,arguments)},vb=a._emscripten_bind_DracoUInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt8Array___destroy___0.apply(null,arguments)},Ra=a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply(null,arguments)},wb=a._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt32Array_GetValue_1.apply(null,
arguments)},xb=a._emscripten_bind_DracoUInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_size_0.apply(null,arguments)},yb=a._emscripten_bind_DracoUInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt32Array___destroy___0.apply(null,arguments)},Sa=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},zb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=
function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},Ab=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},Bb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},Ta=a._emscripten_bind_PointAttribute_PointAttribute_0=
function(){return a.asm.emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},Cb=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm.emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Db=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm.emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},Eb=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm.emscripten_bind_PointAttribute_attribute_type_0.apply(null,
arguments)},Fb=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm.emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},Gb=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm.emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},Hb=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm.emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Ib=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_stride_0.apply(null,
arguments)},Jb=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},Kb=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm.emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},Lb=a._emscripten_bind_PointAttribute___destroy___0=function(){return a.asm.emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},Ua=a._emscripten_bind_AttributeTransformData_AttributeTransformData_0=
function(){return a.asm.emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply(null,arguments)},Mb=a._emscripten_bind_AttributeTransformData_transform_type_0=function(){return a.asm.emscripten_bind_AttributeTransformData_transform_type_0.apply(null,arguments)},Nb=a._emscripten_bind_AttributeTransformData___destroy___0=function(){return a.asm.emscripten_bind_AttributeTransformData___destroy___0.apply(null,arguments)},Va=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=
function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},Ob=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},Pb=a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply(null,arguments)},
Qb=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,arguments)},Rb=a._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_range_0.apply(null,arguments)},Sb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)},
Wa=a._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return a.asm.emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply(null,arguments)},Tb=a._emscripten_bind_DracoInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt8Array_GetValue_1.apply(null,arguments)},Ub=a._emscripten_bind_DracoInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoInt8Array_size_0.apply(null,arguments)},Vb=a._emscripten_bind_DracoInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt8Array___destroy___0.apply(null,
arguments)},Xa=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm.emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},Wb=a._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},Xb=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},Yb=a._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=
function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntryArray_3.apply(null,arguments)},Zb=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},$b=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},ac=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return a.asm.emscripten_bind_MetadataQuerier_NumEntries_1.apply(null,
arguments)},bc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,arguments)},cc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm.emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},Ya=a._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return a.asm.emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt16Array_GetValue_1=
function(){return a.asm.emscripten_bind_DracoInt16Array_GetValue_1.apply(null,arguments)},ec=a._emscripten_bind_DracoInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoInt16Array_size_0.apply(null,arguments)},fc=a._emscripten_bind_DracoInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt16Array___destroy___0.apply(null,arguments)},Za=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null,
arguments)},gc=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},hc=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},ic=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},$a=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm.emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,
arguments)},jc=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm.emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},ab=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return a.asm.emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},kc=a._emscripten_bind_DecoderBuffer_Init_2=function(){return a.asm.emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},lc=a._emscripten_bind_DecoderBuffer___destroy___0=function(){return a.asm.emscripten_bind_DecoderBuffer___destroy___0.apply(null,
arguments)},bb=a._emscripten_bind_Decoder_Decoder_0=function(){return a.asm.emscripten_bind_Decoder_Decoder_0.apply(null,arguments)},mc=a._emscripten_bind_Decoder_GetEncodedGeometryType_1=function(){return a.asm.emscripten_bind_Decoder_GetEncodedGeometryType_1.apply(null,arguments)},nc=a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply(null,arguments)},oc=a._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToMesh_2.apply(null,
arguments)},pc=a._emscripten_bind_Decoder_GetAttributeId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeId_2.apply(null,arguments)},qc=a._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByName_2.apply(null,arguments)},rc=a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply(null,arguments)},sc=a._emscripten_bind_Decoder_GetAttribute_2=
function(){return a.asm.emscripten_bind_Decoder_GetAttribute_2.apply(null,arguments)},tc=a._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply(null,arguments)},uc=a._emscripten_bind_Decoder_GetMetadata_1=function(){return a.asm.emscripten_bind_Decoder_GetMetadata_1.apply(null,arguments)},vc=a._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeMetadata_2.apply(null,
arguments)},wc=a._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return a.asm.emscripten_bind_Decoder_GetFaceFromMesh_3.apply(null,arguments)},xc=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return a.asm.emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply(null,arguments)},yc=a._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt16Array_3.apply(null,arguments)},zc=a._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=
function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt32Array_3.apply(null,arguments)},Ac=a._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloat_3.apply(null,arguments)},Bc=a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply(null,arguments)},Cc=a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply(null,
arguments)},Dc=a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply(null,arguments)},Ec=a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply(null,arguments)},Fc=a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply(null,arguments)},
Gc=a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply(null,arguments)},Hc=a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply(null,arguments)},Ic=a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply(null,arguments)},Jc=
a._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return a.asm.emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5.apply(null,arguments)},Kc=a._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return a.asm.emscripten_bind_Decoder_SkipAttributeTransform_1.apply(null,arguments)},Lc=a._emscripten_bind_Decoder___destroy___0=function(){return a.asm.emscripten_bind_Decoder___destroy___0.apply(null,arguments)},cb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm.emscripten_bind_Mesh_Mesh_0.apply(null,
arguments)},Mc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm.emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},Nc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm.emscripten_bind_Mesh_num_attributes_0.apply(null,arguments)},Oc=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm.emscripten_bind_Mesh_num_points_0.apply(null,arguments)},Pc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm.emscripten_bind_Mesh___destroy___0.apply(null,arguments)},
Qc=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm.emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},db=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm.emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Rc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},Sc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoInt32Array_size_0.apply(null,
arguments)},Tc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},eb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm.emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},Uc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm.emscripten_bind_Metadata___destroy___0.apply(null,arguments)},Vc=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm.emscripten_enum_draco_StatusCode_OK.apply(null,
arguments)},Wc=a._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_DRACO_ERROR.apply(null,arguments)},Xc=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Yc=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm.emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=
function(){return a.asm.emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm.emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},ad=a._emscripten_enum_draco_DataType_DT_INVALID=function(){return a.asm.emscripten_enum_draco_DataType_DT_INVALID.apply(null,arguments)},bd=a._emscripten_enum_draco_DataType_DT_INT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT8.apply(null,
arguments)},cd=a._emscripten_enum_draco_DataType_DT_UINT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT8.apply(null,arguments)},dd=a._emscripten_enum_draco_DataType_DT_INT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT16.apply(null,arguments)},ed=a._emscripten_enum_draco_DataType_DT_UINT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT16.apply(null,arguments)},fd=a._emscripten_enum_draco_DataType_DT_INT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT32.apply(null,
arguments)},gd=a._emscripten_enum_draco_DataType_DT_UINT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT32.apply(null,arguments)},hd=a._emscripten_enum_draco_DataType_DT_INT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT64.apply(null,arguments)},id=a._emscripten_enum_draco_DataType_DT_UINT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT64.apply(null,arguments)},jd=a._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT32.apply(null,
arguments)},kd=a._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT64.apply(null,arguments)},ld=a._emscripten_enum_draco_DataType_DT_BOOL=function(){return a.asm.emscripten_enum_draco_DataType_DT_BOOL.apply(null,arguments)},md=a._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return a.asm.emscripten_enum_draco_DataType_DT_TYPES_COUNT.apply(null,arguments)},nd=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,
arguments)},od=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},pd=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},qd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null,
arguments)},rd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},sd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},td=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null,
arguments)},ud=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},vd=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},wd=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},xd=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=
function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},yd=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},zd=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)};a._setThrew=function(){return a.asm.setThrew.apply(null,arguments)};var ta=a.__ZSt18uncaught_exceptionv=
function(){return a.asm._ZSt18uncaught_exceptionv.apply(null,arguments)};a._free=function(){return a.asm.free.apply(null,arguments)};var ib=a._malloc=function(){return a.asm.malloc.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.__growWasmMemory=function(){return a.asm.__growWasmMemory.apply(null,arguments)};
a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)};
a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_iidiiii=function(){return a.asm.dynCall_iidiiii.apply(null,arguments)};a.dynCall_jiji=function(){return a.asm.dynCall_jiji.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.asm=La;var fa;a.then=function(e){if(fa)e(a);
else{var c=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){c&&c();e(a)}}return a};ja=function c(){fa||ma();fa||(ja=c)};a.run=ma;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();ma();p.prototype=Object.create(p.prototype);p.prototype.constructor=p;p.prototype.__class__=p;p.__cache__={};a.WrapperObject=p;a.getCache=u;a.wrapPointer=N;a.castObject=function(a,b){return N(a.ptr,b)};a.NULL=N(0);a.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";
a.__destroy__();delete u(a.__class__)[a.ptr]};a.compare=function(a,b){return a.ptr===b.ptr};a.getPointer=function(a){return a.ptr};a.getClass=function(a){return a.__class__};var n={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(n.needed){for(var c=0;c<n.temps.length;c++)a._free(n.temps[c]);n.temps.length=0;a._free(n.buffer);n.buffer=0;n.size+=n.needed;n.needed=0}n.buffer||(n.size+=128,n.buffer=a._malloc(n.size),t(n.buffer));n.pos=0},alloc:function(c,b){t(n.buffer);c=c.length*b.BYTES_PER_ELEMENT;
c=c+7&-8;n.pos+c>=n.size?(t(0<c),n.needed+=c,b=a._malloc(c),n.temps.push(b)):(b=n.buffer+n.pos,n.pos+=c);return b},copy:function(a,b,d){switch(b.BYTES_PER_ELEMENT){case 2:d>>=1;break;case 4:d>>=2;break;case 8:d>>=3}for(var c=0;c<a.length;c++)b[d+c]=a[c]}};x.prototype=Object.create(p.prototype);x.prototype.constructor=x;x.prototype.__class__=x;x.__cache__={};a.Status=x;x.prototype.code=x.prototype.code=function(){return jb(this.ptr)};x.prototype.ok=x.prototype.ok=function(){return!!kb(this.ptr)};x.prototype.error_msg=
x.prototype.error_msg=function(){return X(lb(this.ptr))};x.prototype.__destroy__=x.prototype.__destroy__=function(){mb(this.ptr)};A.prototype=Object.create(p.prototype);A.prototype.constructor=A;A.prototype.__class__=A;A.__cache__={};a.DracoUInt16Array=A;A.prototype.GetValue=A.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return nb(c,a)};A.prototype.size=A.prototype.size=function(){return ob(this.ptr)};A.prototype.__destroy__=A.prototype.__destroy__=function(){pb(this.ptr)};
B.prototype=Object.create(p.prototype);B.prototype.constructor=B;B.prototype.__class__=B;B.__cache__={};a.PointCloud=B;B.prototype.num_attributes=B.prototype.num_attributes=function(){return qb(this.ptr)};B.prototype.num_points=B.prototype.num_points=function(){return rb(this.ptr)};B.prototype.__destroy__=B.prototype.__destroy__=function(){sb(this.ptr)};C.prototype=Object.create(p.prototype);C.prototype.constructor=C;C.prototype.__class__=C;C.__cache__={};a.DracoUInt8Array=C;C.prototype.GetValue=
C.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return tb(c,a)};C.prototype.size=C.prototype.size=function(){return ub(this.ptr)};C.prototype.__destroy__=C.prototype.__destroy__=function(){vb(this.ptr)};D.prototype=Object.create(p.prototype);D.prototype.constructor=D;D.prototype.__class__=D;D.__cache__={};a.DracoUInt32Array=D;D.prototype.GetValue=D.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return wb(c,a)};D.prototype.size=D.prototype.size=
function(){return xb(this.ptr)};D.prototype.__destroy__=D.prototype.__destroy__=function(){yb(this.ptr)};E.prototype=Object.create(p.prototype);E.prototype.constructor=E;E.prototype.__class__=E;E.__cache__={};a.AttributeOctahedronTransform=E;E.prototype.InitFromAttribute=E.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!zb(c,a)};E.prototype.quantization_bits=E.prototype.quantization_bits=function(){return Ab(this.ptr)};E.prototype.__destroy__=E.prototype.__destroy__=
function(){Bb(this.ptr)};q.prototype=Object.create(p.prototype);q.prototype.constructor=q;q.prototype.__class__=q;q.__cache__={};a.PointAttribute=q;q.prototype.size=q.prototype.size=function(){return Cb(this.ptr)};q.prototype.GetAttributeTransformData=q.prototype.GetAttributeTransformData=function(){return N(Db(this.ptr),J)};q.prototype.attribute_type=q.prototype.attribute_type=function(){return Eb(this.ptr)};q.prototype.data_type=q.prototype.data_type=function(){return Fb(this.ptr)};q.prototype.num_components=
q.prototype.num_components=function(){return Gb(this.ptr)};q.prototype.normalized=q.prototype.normalized=function(){return!!Hb(this.ptr)};q.prototype.byte_stride=q.prototype.byte_stride=function(){return Ib(this.ptr)};q.prototype.byte_offset=q.prototype.byte_offset=function(){return Jb(this.ptr)};q.prototype.unique_id=q.prototype.unique_id=function(){return Kb(this.ptr)};q.prototype.__destroy__=q.prototype.__destroy__=function(){Lb(this.ptr)};J.prototype=Object.create(p.prototype);J.prototype.constructor=
J;J.prototype.__class__=J;J.__cache__={};a.AttributeTransformData=J;J.prototype.transform_type=J.prototype.transform_type=function(){return Mb(this.ptr)};J.prototype.__destroy__=J.prototype.__destroy__=function(){Nb(this.ptr)};w.prototype=Object.create(p.prototype);w.prototype.constructor=w;w.prototype.__class__=w;w.__cache__={};a.AttributeQuantizationTransform=w;w.prototype.InitFromAttribute=w.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!Ob(c,a)};
w.prototype.quantization_bits=w.prototype.quantization_bits=function(){return Pb(this.ptr)};w.prototype.min_value=w.prototype.min_value=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Qb(c,a)};w.prototype.range=w.prototype.range=function(){return Rb(this.ptr)};w.prototype.__destroy__=w.prototype.__destroy__=function(){Sb(this.ptr)};F.prototype=Object.create(p.prototype);F.prototype.constructor=F;F.prototype.__class__=F;F.__cache__={};a.DracoInt8Array=F;F.prototype.GetValue=F.prototype.GetValue=
function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Tb(c,a)};F.prototype.size=F.prototype.size=function(){return Ub(this.ptr)};F.prototype.__destroy__=F.prototype.__destroy__=function(){Vb(this.ptr)};r.prototype=Object.create(p.prototype);r.prototype.constructor=r;r.prototype.__class__=r;r.__cache__={};a.MetadataQuerier=r;r.prototype.HasEntry=r.prototype.HasEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return!!Wb(c,
a,b)};r.prototype.GetIntEntry=r.prototype.GetIntEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return Xb(c,a,b)};r.prototype.GetIntEntryArray=r.prototype.GetIntEntryArray=function(a,b,d){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);d&&"object"===typeof d&&(d=d.ptr);Yb(c,a,b,d)};r.prototype.GetDoubleEntry=r.prototype.GetDoubleEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===
typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return Zb(c,a,b)};r.prototype.GetStringEntry=r.prototype.GetStringEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return X($b(c,a,b))};r.prototype.NumEntries=r.prototype.NumEntries=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return ac(c,a)};r.prototype.GetEntryName=r.prototype.GetEntryName=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===
typeof b&&(b=b.ptr);return X(bc(c,a,b))};r.prototype.__destroy__=r.prototype.__destroy__=function(){cc(this.ptr)};G.prototype=Object.create(p.prototype);G.prototype.constructor=G;G.prototype.__class__=G;G.__cache__={};a.DracoInt16Array=G;G.prototype.GetValue=G.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return dc(c,a)};G.prototype.size=G.prototype.size=function(){return ec(this.ptr)};G.prototype.__destroy__=G.prototype.__destroy__=function(){fc(this.ptr)};H.prototype=
Object.create(p.prototype);H.prototype.constructor=H;H.prototype.__class__=H;H.__cache__={};a.DracoFloat32Array=H;H.prototype.GetValue=H.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return gc(c,a)};H.prototype.size=H.prototype.size=function(){return hc(this.ptr)};H.prototype.__destroy__=H.prototype.__destroy__=function(){ic(this.ptr)};O.prototype=Object.create(p.prototype);O.prototype.constructor=O;O.prototype.__class__=O;O.__cache__={};a.GeometryAttribute=O;O.prototype.__destroy__=
O.prototype.__destroy__=function(){jc(this.ptr)};K.prototype=Object.create(p.prototype);K.prototype.constructor=K;K.prototype.__class__=K;K.__cache__={};a.DecoderBuffer=K;K.prototype.Init=K.prototype.Init=function(a,b){var c=this.ptr;n.prepare();if("object"==typeof a&&"object"===typeof a){var e=n.alloc(a,T);n.copy(a,T,e);a=e}b&&"object"===typeof b&&(b=b.ptr);kc(c,a,b)};K.prototype.__destroy__=K.prototype.__destroy__=function(){lc(this.ptr)};g.prototype=Object.create(p.prototype);g.prototype.constructor=
g;g.prototype.__class__=g;g.__cache__={};a.Decoder=g;g.prototype.GetEncodedGeometryType=g.prototype.GetEncodedGeometryType=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return mc(c,a)};g.prototype.DecodeBufferToPointCloud=g.prototype.DecodeBufferToPointCloud=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(nc(c,a,b),x)};g.prototype.DecodeBufferToMesh=g.prototype.DecodeBufferToMesh=function(a,b){var c=this.ptr;a&&"object"===typeof a&&
(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(oc(c,a,b),x)};g.prototype.GetAttributeId=g.prototype.GetAttributeId=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return pc(c,a,b)};g.prototype.GetAttributeIdByName=g.prototype.GetAttributeIdByName=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return qc(c,a,b)};g.prototype.GetAttributeIdByMetadataEntry=g.prototype.GetAttributeIdByMetadataEntry=
function(a,b,d){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);d=d&&"object"===typeof d?d.ptr:V(d);return rc(c,a,b,d)};g.prototype.GetAttribute=g.prototype.GetAttribute=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(sc(c,a,b),q)};g.prototype.GetAttributeByUniqueId=g.prototype.GetAttributeByUniqueId=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);
return N(tc(c,a,b),q)};g.prototype.GetMetadata=g.prototype.GetMetadata=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return N(uc(c,a),L)};g.prototype.GetAttributeMetadata=g.prototype.GetAttributeMetadata=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(vc(c,a,b),L)};g.prototype.GetFaceFromMesh=g.prototype.GetFaceFromMesh=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===
typeof d&&(d=d.ptr);return!!wc(c,a,b,d)};g.prototype.GetTriangleStripsFromMesh=g.prototype.GetTriangleStripsFromMesh=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return xc(c,a,b)};g.prototype.GetTrianglesUInt16Array=g.prototype.GetTrianglesUInt16Array=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!yc(c,a,b,d)};g.prototype.GetTrianglesUInt32Array=g.prototype.GetTrianglesUInt32Array=
function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!zc(c,a,b,d)};g.prototype.GetAttributeFloat=g.prototype.GetAttributeFloat=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ac(c,a,b,d)};g.prototype.GetAttributeFloatForAllPoints=g.prototype.GetAttributeFloatForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&
(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Bc(c,a,b,d)};g.prototype.GetAttributeIntForAllPoints=g.prototype.GetAttributeIntForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Cc(c,a,b,d)};g.prototype.GetAttributeInt8ForAllPoints=g.prototype.GetAttributeInt8ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&
(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Dc(c,a,b,d)};g.prototype.GetAttributeUInt8ForAllPoints=g.prototype.GetAttributeUInt8ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ec(c,a,b,d)};g.prototype.GetAttributeInt16ForAllPoints=g.prototype.GetAttributeInt16ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&
(d=d.ptr);return!!Fc(c,a,b,d)};g.prototype.GetAttributeUInt16ForAllPoints=g.prototype.GetAttributeUInt16ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Gc(c,a,b,d)};g.prototype.GetAttributeInt32ForAllPoints=g.prototype.GetAttributeInt32ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Hc(c,
a,b,d)};g.prototype.GetAttributeUInt32ForAllPoints=g.prototype.GetAttributeUInt32ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ic(c,a,b,d)};g.prototype.GetAttributeDataArrayForAllPoints=g.prototype.GetAttributeDataArrayForAllPoints=function(a,b,d,e,f){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);e&&"object"===typeof e&&
(e=e.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Jc(c,a,b,d,e,f)};g.prototype.SkipAttributeTransform=g.prototype.SkipAttributeTransform=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);Kc(b,a)};g.prototype.__destroy__=g.prototype.__destroy__=function(){Lc(this.ptr)};y.prototype=Object.create(p.prototype);y.prototype.constructor=y;y.prototype.__class__=y;y.__cache__={};a.Mesh=y;y.prototype.num_faces=y.prototype.num_faces=function(){return Mc(this.ptr)};y.prototype.num_attributes=y.prototype.num_attributes=
function(){return Nc(this.ptr)};y.prototype.num_points=y.prototype.num_points=function(){return Oc(this.ptr)};y.prototype.__destroy__=y.prototype.__destroy__=function(){Pc(this.ptr)};Q.prototype=Object.create(p.prototype);Q.prototype.constructor=Q;Q.prototype.__class__=Q;Q.__cache__={};a.VoidPtr=Q;Q.prototype.__destroy__=Q.prototype.__destroy__=function(){Qc(this.ptr)};I.prototype=Object.create(p.prototype);I.prototype.constructor=I;I.prototype.__class__=I;I.__cache__={};a.DracoInt32Array=I;I.prototype.GetValue=
I.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Rc(b,a)};I.prototype.size=I.prototype.size=function(){return Sc(this.ptr)};I.prototype.__destroy__=I.prototype.__destroy__=function(){Tc(this.ptr)};L.prototype=Object.create(p.prototype);L.prototype.constructor=L;L.prototype.__class__=L;L.__cache__={};a.Metadata=L;L.prototype.__destroy__=L.prototype.__destroy__=function(){Uc(this.ptr)};(function(){function c(){a.OK=Vc();a.DRACO_ERROR=Wc();a.IO_ERROR=Xc();a.INVALID_PARAMETER=
Yc();a.UNSUPPORTED_VERSION=Zc();a.UNKNOWN_VERSION=$c();a.DT_INVALID=ad();a.DT_INT8=bd();a.DT_UINT8=cd();a.DT_INT16=dd();a.DT_UINT16=ed();a.DT_INT32=fd();a.DT_UINT32=gd();a.DT_INT64=hd();a.DT_UINT64=id();a.DT_FLOAT32=jd();a.DT_FLOAT64=kd();a.DT_BOOL=ld();a.DT_TYPES_COUNT=md();a.INVALID_GEOMETRY_TYPE=nd();a.POINT_CLOUD=od();a.TRIANGULAR_MESH=pd();a.ATTRIBUTE_INVALID_TRANSFORM=qd();a.ATTRIBUTE_NO_TRANSFORM=rd();a.ATTRIBUTE_QUANTIZATION_TRANSFORM=sd();a.ATTRIBUTE_OCTAHEDRON_TRANSFORM=td();a.INVALID=ud();
a.POSITION=vd();a.NORMAL=wd();a.COLOR=xd();a.TEX_COORD=yd();a.GENERIC=zd()}Ba?c():Da.unshift(c)})();if("function"===typeof a.onModuleParsed)a.onModuleParsed();return m}}();"object"===typeof exports&&"object"===typeof module?module.exports=DracoDecoderModule:"function"===typeof define&&define.amd?define([],function(){return DracoDecoderModule}):"object"===typeof exports&&(exports.DracoDecoderModule=DracoDecoderModule);

167
3d/lib/stats.module.js Normal file
View File

@ -0,0 +1,167 @@
var Stats = function () {
var mode = 0;
var container = document.createElement( 'div' );
container.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';
container.addEventListener( 'click', function ( event ) {
event.preventDefault();
showPanel( ++ mode % container.children.length );
}, false );
//
function addPanel( panel ) {
container.appendChild( panel.dom );
return panel;
}
function showPanel( id ) {
for ( var i = 0; i < container.children.length; i ++ ) {
container.children[ i ].style.display = i === id ? 'block' : 'none';
}
mode = id;
}
//
var beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;
var fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );
var msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );
if ( self.performance && self.performance.memory ) {
var memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );
}
showPanel( 0 );
return {
REVISION: 16,
dom: container,
addPanel: addPanel,
showPanel: showPanel,
begin: function () {
beginTime = ( performance || Date ).now();
},
end: function () {
frames ++;
var time = ( performance || Date ).now();
msPanel.update( time - beginTime, 200 );
if ( time >= prevTime + 1000 ) {
fpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );
prevTime = time;
frames = 0;
if ( memPanel ) {
var memory = performance.memory;
memPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 );
}
}
return time;
},
update: function () {
beginTime = this.end();
},
// Backwards Compatibility
domElement: container,
setMode: showPanel
};
};
Stats.Panel = function ( name, fg, bg ) {
var min = Infinity, max = 0, round = Math.round;
var PR = round( window.devicePixelRatio || 1 );
var WIDTH = 80 * PR, HEIGHT = 48 * PR,
TEXT_X = 3 * PR, TEXT_Y = 2 * PR,
GRAPH_X = 3 * PR, GRAPH_Y = 15 * PR,
GRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;
var canvas = document.createElement( 'canvas' );
canvas.width = WIDTH;
canvas.height = HEIGHT;
canvas.style.cssText = 'width:80px;height:48px';
var context = canvas.getContext( '2d' );
context.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif';
context.textBaseline = 'top';
context.fillStyle = bg;
context.fillRect( 0, 0, WIDTH, HEIGHT );
context.fillStyle = fg;
context.fillText( name, TEXT_X, TEXT_Y );
context.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );
context.fillStyle = bg;
context.globalAlpha = 0.9;
context.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );
return {
dom: canvas,
update: function ( value, maxValue ) {
min = Math.min( min, value );
max = Math.max( max, value );
context.fillStyle = bg;
context.globalAlpha = 1;
context.fillRect( 0, 0, WIDTH, GRAPH_Y );
context.fillStyle = fg;
context.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y );
context.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT );
context.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT );
context.fillStyle = bg;
context.globalAlpha = 0.9;
context.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) );
}
};
};
export default Stats;

50312
3d/lib/three.module.js Normal file

File diff suppressed because one or more lines are too long

BIN
3d/model/LittlestTokyo.glb Normal file

Binary file not shown.

View File

@ -30,6 +30,8 @@ RUN dotnet publish "IoTGateway.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY drivers /app/drivers/
COPY 3d /app/wwwroot/3d/
COPY --from=publish /app/publish .
ENV TZ=Asia/Shanghai

Binary file not shown.

View File

@ -80,7 +80,7 @@ namespace IoTGateway.DataAccess
{
public DataContext CreateDbContext(string[] args)
{
return new DataContext("Data Source = ../IoTGateway/iotgateway.db", DBTypeEnum.SQLite);
return new DataContext("Data Source = ../IoTGateway/data/iotgateway.db", DBTypeEnum.SQLite);
}
}

View File

@ -0,0 +1,865 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20221206143332_EndianType")]
partial class EndianType
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<int>("EndianType")
.HasColumnType("INTEGER");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Params")
.HasColumnType("TEXT");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,26 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class EndianType : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "EndianType",
table: "DeviceVariables",
type: "INTEGER",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "EndianType",
table: "DeviceVariables");
}
}
}

View File

@ -0,0 +1,871 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20230412061736_IsUpload")]
partial class IsUpload
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Alias")
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<int>("EndianType")
.HasColumnType("INTEGER");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<bool>("IsUpload")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Params")
.HasColumnType("TEXT");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,36 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class IsUpload : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Alias",
table: "DeviceVariables",
type: "TEXT",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsUpload",
table: "DeviceVariables",
type: "INTEGER",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Alias",
table: "DeviceVariables");
migrationBuilder.DropColumn(
name: "IsUpload",
table: "DeviceVariables");
}
}
}

View File

@ -0,0 +1,874 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20240531142726_IsTrigger")]
partial class IsTrigger
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Alias")
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<int>("EndianType")
.HasColumnType("INTEGER");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<bool>("IsTrigger")
.HasColumnType("INTEGER");
b.Property<bool>("IsUpload")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Params")
.HasColumnType("TEXT");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,26 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class IsTrigger : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsTrigger",
table: "DeviceVariables",
type: "INTEGER",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsTrigger",
table: "DeviceVariables");
}
}
}

View File

@ -0,0 +1,951 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20240719011950_CommentAndIndex")]
partial class CommentAndIndex
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER")
.HasComment("启动");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER")
.HasComment("变化上传");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER")
.HasComment("指令间隔ms");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceName")
.HasColumnType("TEXT")
.HasComment("名称");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER")
.HasComment("类型(组或设备)");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT")
.HasComment("驱动");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER")
.HasComment("归档周期ms");
b.Property<uint>("Index")
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("AutoStart");
b.HasIndex("DeviceName");
b.HasIndex("DeviceTypeEnum");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
b.HasComment("设备维护");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER")
.HasComment("属性侧");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT")
.HasComment("名称");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT")
.HasComment("备注");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT")
.HasComment("值");
b.HasKey("ID");
b.HasIndex("DeviceConfigName");
b.HasIndex("DeviceId");
b.HasIndex("Value");
b.ToTable("DeviceConfigs");
b.HasComment("通讯配置");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Alias")
.HasColumnType("TEXT")
.HasComment("别名");
b.Property<int>("DataType")
.HasColumnType("INTEGER")
.HasComment("数据类型");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT")
.HasComment("地址");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<int>("EndianType")
.HasColumnType("INTEGER")
.HasComment("大小端");
b.Property<string>("Expressions")
.HasColumnType("TEXT")
.HasComment("表达式");
b.Property<uint>("Index")
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property<bool>("IsTrigger")
.HasColumnType("INTEGER")
.HasComment("触发");
b.Property<bool>("IsUpload")
.HasColumnType("INTEGER")
.HasComment("上传");
b.Property<string>("Method")
.HasColumnType("TEXT")
.HasComment("方法");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasComment("变量名");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER")
.HasComment("权限");
b.HasKey("ID");
b.HasIndex("DataType");
b.HasIndex("DeviceAddress");
b.HasIndex("DeviceId");
b.HasIndex("Method");
b.HasIndex("Name");
b.ToTable("DeviceVariables");
b.HasComment("变量配置");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT")
.HasComment("程序集名");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER")
.HasComment("剩余授权数");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT")
.HasComment("驱动名");
b.Property<string>("FileName")
.HasColumnType("TEXT")
.HasComment("文件名");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
b.HasComment("驱动管理");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT")
.HasComment("结束时间");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER")
.HasComment("是否成功");
b.Property<string>("Method")
.HasColumnType("TEXT")
.HasComment("方法");
b.Property<string>("Params")
.HasColumnType("TEXT")
.HasComment("请求参数");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER")
.HasComment("发起方");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT")
.HasComment("开始时间");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
b.HasComment("RPC日志");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT")
.HasComment("ClientId");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT")
.HasComment("网关名称");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER")
.HasComment("输出平台");
b.Property<string>("MqttIp")
.HasColumnType("TEXT")
.HasComment("Mqtt服务器");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER")
.HasComment("Mqtt端口");
b.Property<string>("MqttUName")
.HasColumnType("TEXT")
.HasComment("Mqtt用户名");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT")
.HasComment("Mqtt密码");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
b.HasComment("传输配置");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -24,13 +24,16 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("启动");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("变化上传");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("指令间隔ms");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
@ -39,22 +42,28 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("名称");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("类型(组或设备)");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("驱动");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("归档周期ms");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
@ -67,11 +76,19 @@ namespace IoTGateway.DataAccess.Migrations
b.HasKey("ID");
b.HasIndex("AutoStart");
b.HasIndex("DeviceName");
b.HasIndex("DeviceTypeEnum");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
b.HasComment("设备维护");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
@ -88,19 +105,24 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("属性侧");
b.Property<string>("Description")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("名称");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("备注");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
@ -110,13 +132,20 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("值");
b.HasKey("ID");
b.HasIndex("DeviceConfigName");
b.HasIndex("DeviceId");
b.HasIndex("Value");
b.ToTable("DeviceConfigs");
b.HasComment("通讯配置");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
@ -125,38 +154,73 @@ namespace IoTGateway.DataAccess.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Alias")
.HasColumnType("TEXT")
.HasComment("别名");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("数据类型");
b.Property<string>("Description")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("地址");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<int>("EndianType")
.HasColumnType("INTEGER")
.HasComment("大小端");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("表达式");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property<bool>("IsTrigger")
.HasColumnType("INTEGER")
.HasComment("触发");
b.Property<bool>("IsUpload")
.HasColumnType("INTEGER")
.HasComment("上传");
b.Property<string>("Method")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("方法");
b.Property<string>("Name")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("变量名");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("权限");
b.HasKey("ID");
b.HasIndex("DataType");
b.HasIndex("DeviceAddress");
b.HasIndex("DeviceId");
b.HasIndex("Method");
b.HasIndex("Name");
b.ToTable("DeviceVariables");
b.HasComment("变量配置");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
@ -166,10 +230,12 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("程序集名");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("剩余授权数");
b.Property<string>("CreateBy")
.HasMaxLength(50)
@ -179,10 +245,12 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("驱动名");
b.Property<string>("FileName")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("文件名");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
@ -194,6 +262,8 @@ namespace IoTGateway.DataAccess.Migrations
b.HasKey("ID");
b.ToTable("Drivers");
b.HasComment("驱动管理");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
@ -203,34 +273,44 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("结束时间");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("是否成功");
b.Property<string>("Method")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("方法");
b.Property<string>("Params")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("请求参数");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("发起方");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("开始时间");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
b.HasComment("RPC日志");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
@ -240,7 +320,8 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("ClientId");
b.Property<string>("CreateBy")
.HasMaxLength(50)
@ -250,22 +331,28 @@ namespace IoTGateway.DataAccess.Migrations
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("网关名称");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("输出平台");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("Mqtt服务器");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
.HasColumnType("INTEGER")
.HasComment("Mqtt端口");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("Mqtt用户名");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasComment("Mqtt密码");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
@ -277,6 +364,8 @@ namespace IoTGateway.DataAccess.Migrations
b.HasKey("ID");
b.ToTable("SystemConfig");
b.HasComment("传输配置");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>

View File

@ -4,26 +4,26 @@ namespace IoTGateway.Model
{
public enum DeviceTypeEnum
{
[Display(Name = "采集组")]
[Display(Name = "Group")]
Group = 0,
[Display(Name = "采集点")]
[Display(Name = "Device")]
Device = 1
}
public enum AccessEnum
{
[Display(Name = "只读")]
[Display(Name = "ReadOnly")]
ReadOnly = 0,
[Display(Name = "读写")]
[Display(Name = "ReadWrite")]
ReadAndWrite = 1
}
public enum DataSide
{
[Display(Name ="共享属性")]
[Display(Name = "AnySide")]
AnySide=0,
//ServerSide=1,
[Display(Name = "客户端属性")]
[Display(Name = "ClientSide")]
ClientSide =2,
}
}

View File

@ -1,47 +1,62 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.CompilerServices;
using Microsoft.EntityFrameworkCore;
using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model
{
[Comment("设备维护")]
[Index(nameof(DeviceName))]
[Index(nameof(AutoStart))]
[Index(nameof(DeviceTypeEnum))]
public class Device : TreePoco<Device>, IBasePoco
{
[Display(Name = "名称")]
[Comment("名称")]
[Display(Name = "DeviceName")]
public string DeviceName { get; set; }
[Display(Name = "排序")]
[Comment("排序")]
[Display(Name = "Sort")]
public uint Index { get; set; }
[Display(Name = "描述")]
[Comment("描述")]
[Display(Name = "Description")]
public string Description { get; set; }
public Driver Driver { get; set; }
[Display(Name = "驱动")]
[Comment("驱动")]
[Display(Name = "Driver")]
public Guid? DriverId { get; set; }
[Display(Name = "启动")]
[Comment("启动")]
[Display(Name = "AutoStart")]
public bool AutoStart { get; set; }
[Display(Name = "变化上传")]
[Comment("变化上传")]
[Display(Name = "ChangeUpload")]
public bool CgUpload { get; set; }
[Display(Name = "归档周期ms")]
[Comment("归档周期ms")]
[Display(Name = "EnforcePeriodms")]
public uint EnforcePeriod { get; set; }
[Display(Name = "指令间隔ms")]
[Comment("指令间隔ms")]
[Display(Name = "CmdPeriodms")]
public uint CmdPeriod { get; set; }
[Display(Name = "类型")]
[Comment("类型(组或设备)")]
[Display(Name = "Type")]
public DeviceTypeEnum DeviceTypeEnum { get; set; }
[Display(Name = "创建时间")]
[Display(Name = "CreateTime")]
public DateTime? CreateTime { get; set; }
[Display(Name = "创建人")]
[Display(Name = "CreateBy")]
public string CreateBy { get; set; }
[Display(Name = "更新时间")]
[Display(Name = "UpdateTime")]
public DateTime? UpdateTime { get; set; }
[Display(Name = "更新人")]
[Display(Name = "UpdateBy")]
public string UpdateBy { get; set; }
public List<DeviceConfig> DeviceConfigs { get; set; }

View File

@ -1,23 +1,39 @@
using System;
using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model
{
[Comment("通讯配置")]
[Index(nameof(DeviceConfigName))]
[Index(nameof(Value))]
public class DeviceConfig : BasePoco
{
[Display(Name = "名称")]
[Comment("名称")]
[Display(Name = "ConfigName")]
public string DeviceConfigName { get; set; }
[Display(Name = "属性侧")]
[Comment("属性侧")]
[Display(Name = "DataSide")]
public DataSide DataSide { get; set; }
[Display(Name = "描述")]
[Comment("描述")]
[Display(Name = "Description")]
public string Description { get; set; }
[Display(Name = "值")]
[Comment("值")]
[Display(Name = "Value")]
public string Value { get; set; }
[Display(Name = "备注")]
[Comment("备注")]
[Display(Name = "Remark")]
public string EnumInfo { get; set; }
public Device Device { get; set; }
[Display(Name = "设备")]
[Comment("所属设备")]
[Display(Name = "Device")]
public Guid? DeviceId { get; set; }
}
}

View File

@ -1,39 +1,117 @@
using PluginInterface;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using WalkingTec.Mvvm.Core;
using Microsoft.EntityFrameworkCore;
namespace IoTGateway.Model
{
[Comment("变量配置")]
[Index(nameof(Name))]
[Index(nameof(Method))]
[Index(nameof(DeviceAddress))]
[Index(nameof(DataType))]
public class DeviceVariable : TopBasePoco, IVariable
{
[Display(Name = "变量名")]
[Comment("变量名")]
[Display(Name = "VariableName")]
public string Name { get; set; }
[Display(Name = "描述")]
[Comment("描述")]
[Display(Name = "Description")]
public string Description { get; set; }
[Display(Name = "方法")]
[Comment("方法")]
[Display(Name = "Method")]
public string Method { get; set; }
[Display(Name = "地址")]
[Comment("地址")]
[Display(Name = "Address")]
public string DeviceAddress { get; set; }
[Display(Name = "类型")]
public PluginInterface.DataTypeEnum DataType { get; set; }
[Comment("数据类型")]
[Display(Name = "DataType")]
public DataTypeEnum DataType { get; set; }
[Display(Name = "表达式")]
[Comment("触发")]
[Display(Name = "IsTrigger")]
public bool IsTrigger { get; set; }
[Comment("大小端")]
[Display(Name = "EndianType")]
public EndianEnum EndianType { get; set; }
[Comment("表达式")]
[Display(Name = "Expressions")]
public string Expressions { get; set; }
[Display(Name = "权限")]
[Comment("上传")]
[Display(Name = "Upload")]
public bool IsUpload { get; set; }
[Comment("权限")]
[Display(Name = "Permissions")]
public ProtectTypeEnum ProtectType { get; set; }
[Display(Name = "排序")]
[Comment("排序")]
[Display(Name = "Sort")]
public uint Index { get; set; }
[Newtonsoft.Json.JsonIgnore]
public Device Device { get; set; }
[Display(Name = "设备")]
[Comment("所属设备")]
[Display(Name = "Device")]
public Guid? DeviceId { get; set; }
[Comment("别名")]
[Display(Name = "Alias")]
public string Alias { get; set; }
[Comment("原值")]
[NotMapped]
[Display(Name = "RawValue")]
public object Value { get; set; }
[Comment("计算后的值")]
[NotMapped]
[Display(Name = "CookedValue")]
public object CookedValue { get; set; }
[Comment("错误信息")]
[NotMapped]
[Display(Name = "Message")]
public string Message { get; set; }
[Comment("更新时间")]
[NotMapped]
[Display(Name = "Timestamp")]
public DateTime Timestamp { get; set; }
[Comment("状态")]
[NotMapped]
[Display(Name = "Status")]
[JsonConverter(typeof(StringEnumConverter))]
public VaribaleStatusTypeEnum StatusType { get; set; } = VaribaleStatusTypeEnum.UnKnow;
[Comment("最新三次原值")]
[NotMapped][Display(Name = "MostRecentValues")] public object[] Values { get; set; } = new object[3];
[Comment("最新三次计算后的值")]
[NotMapped][Display(Name = "MostRecentCookedValues")] public object[] CookedValues { get; set; } = new object[3];
public void EnqueueVariable(object value)
{
Values[2] = Values[1];
Values[1] = Values[0];
Values[0] = value;
}
public void EnqueueCookedVariable(object value)
{
CookedValues[2] = CookedValues[1];
CookedValues[1] = CookedValues[0];
CookedValues[0] = value;
}
}
}

View File

@ -1,18 +1,27 @@
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model
{
[Comment("驱动管理")]
public class Driver : BasePoco
{
[Display(Name = "驱动名")]
[Comment("驱动名")]
[Display(Name = "DriverName")]
public string DriverName { get; set; }
[Display(Name = "文件名")]
[Comment("文件名")]
[Display(Name = "FileName")]
public string FileName { get; set; }
[Display(Name = "程序集名")]
[Comment("程序集名")]
[Display(Name = "AssembleName")]
public string AssembleName { get; set; }
[Display(Name = "剩余授权数量")]
[Comment("剩余授权数")]
[Display(Name = "Remains")]
public int AuthorizesNum { get; set; }
}
}

View File

@ -5,22 +5,22 @@ namespace IoTGateway.Model
{
public interface IVariable
{
[Display(Name = "变量名")]
[Display(Name = "VariableName")]
public string Name { get; set; }
[Display(Name = "描述")]
[Display(Name = "Description")]
public string Description { get; set; }
[Display(Name = "地址")]
[Display(Name = "Address")]
public string DeviceAddress { get; set; }
[Display(Name = "数据类型")]
[Display(Name = "DataType")]
public PluginInterface.DataTypeEnum DataType { get; set; }
[Display(Name = "表达式")]
[Display(Name = "Expressions")]
public string Expressions { get; set; }
[Display(Name = "权限")]
[Display(Name = "Permission")]
public ProtectTypeEnum ProtectType { get; set; }
}
}

View File

@ -1,4 +1,5 @@
using System;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@ -8,40 +9,49 @@ using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model
{
[Comment("RPC日志")]
public class RpcLog:TopBasePoco
{
[Display(Name = "发起方")]
public RpcSide RpcSide { get; set; }
[Comment("发起方")]
[Display(Name = "RpcSide")]
public RpcSide RpcSide { get; set; }
[Display(Name = "开始时间")]
[Comment("开始时间")]
[Display(Name = "StartTime")]
public DateTime StartTime { get; set; }
public Device Device { get; set; }
[Display(Name = "设备名")]
[Comment("所属设备")]
[Display(Name = "Device")]
public Guid? DeviceId { get; set; }
[Display(Name = "方法名")]
[Comment("方法")]
[Display(Name = "Method")]
public string Method { get; set; }
[Display(Name = "请求参数")]
[Comment("请求参数")]
[Display(Name = "Parameters")]
public string Params { get; set; }
[Display(Name = "结束时间")]
[Comment("结束时间")]
[Display(Name = "EndTime")]
public DateTime EndTime { get; set; }
[Display(Name = "结果")]
[Comment("是否成功")]
[Display(Name = "IsSuccess")]
public bool IsSuccess { get; set; }
[Display(Name = "描述")]
[Comment("描述")]
[Display(Name = "Description")]
public string Description { get; set; }
}
public enum RpcSide
{
[Display(Name ="服务端请求")]
[Display(Name = "ServerSide")]
ServerSide=1,
[Display(Name = "客户端请求")]
[Display(Name = "ClientSide")]
ClientSide =1
}
}

View File

@ -1,23 +1,38 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model
{
[Comment("传输配置")]
public class SystemConfig : BasePoco
{
[Display(Name = "网关名称")]
[Comment("网关名称")]
[Display(Name = "GatewayName")]
public string GatewayName { get; set; }
[Comment("ClientId")]
[Display(Name = "ClientId")]
public string ClientId { get; set; }
[Display(Name = "Mqtt服务器")]
[Comment("Mqtt服务器")]
[Display(Name = "MqttServer ")]
public string MqttIp { get; set; }
[Display(Name = "Mqtt端口")]
[Comment("Mqtt端口")]
[Display(Name = "MqttPort")]
public int MqttPort { get; set; }
[Display(Name = "Mqtt用户名")]
[Comment("Mqtt用户名")]
[Display(Name = "UserName")]
public string MqttUName { get; set; }
[Display(Name = "Mqtt密码")]
[Comment("Mqtt密码")]
[Display(Name = "Password")]
public string MqttUPwd { get; set; }
[Display(Name = "输出平台")]
[Comment("输出平台")]
[Display(Name = "OutputPlatform")]
public IoTPlatformType IoTPlatformType { get; set; }
}
public enum IoTPlatformType
@ -26,19 +41,21 @@ namespace IoTGateway.Model
ThingsBoard =0,
[Display(Name = "IoTSharp")]
IoTSharp =1,
[Display(Name = "阿里物联网平台")]
[Display(Name = "AliIoT")]
AliCloudIoT=2,
[Display(Name = "腾讯智能云")]
[Display(Name = "TencentIoTHub")]
TencentIoTHub =3,
[Display(Name = "百度物联网通信")]
[Display(Name = "BaiduIoTCore")]
BaiduIoTCore =4,
[Display(Name = "中移OneNet")]
[Display(Name = "OneNet")]
OneNET = 5,
[Display(Name = "ThingsCloud")]
ThingsCloud = 6,
[Display(Name = "华为云")]
[Display(Name = "HuaWeiCloud")]
HuaWei = 7,
[Display(Name = "IotDB")]
IotDB = 99
[Display(Name = "IoTGateway")]
IoTGateway = 8,
[Display(Name = "ThingsPanel")]
ThingsPanel = 9
}
}

View File

@ -20,7 +20,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceConfigVMs
{
this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "BasicData", dialogWidth: 800),
//this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "BasicData", dialogWidth: 800),
//this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "BasicData", dialogWidth: 800),
@ -58,7 +58,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceConfigVMs
return new List<GridColumn<DeviceConfig_View>>{
this.MakeGridHeader(x => x.DeviceConfigName).SetWidth(100),
this.MakeGridHeader(x => x.DataSide).SetWidth(100),
this.MakeGridHeader(x => x.Description).SetWidth(100),
this.MakeGridHeader(x => x.Description).SetWidth(120),
this.MakeGridHeader(x => x.Value).SetWidth(100),
this.MakeGridHeader(x => x.DeviceName_view).SetWidth(100),
this.MakeGridHeader(x => x.EnumInfo),
@ -93,7 +93,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceConfigVMs
public class DeviceConfig_View : DeviceConfig
{
[Display(Name = "设备名")]
[Display(Name = "DeviceName")]
public String DeviceName_view { get; set; }
}

View File

@ -26,8 +26,8 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
= "复制失败,找不到设备";
else
{
var myMqttClient = Wtm.ServiceProvider.GetService(typeof(MyMqttClient)) as MyMqttClient;
myMqttClient.RequestAttributes(device.DeviceName, true, device.DeviceConfigs.Where(x => x.DataSide == DataSide.AnySide).Select(x => x.DeviceConfigName).ToArray());
var messageService = Wtm.ServiceProvider.GetService(typeof(MessageService)) as MessageService;
messageService.RequestAttributes(device.DeviceName, true, device.DeviceConfigs.Where(x => x.DataSide == DataSide.AnySide).Select(x => x.DeviceConfigName).ToArray());
}
DC.SaveChanges();
transaction.Commit();

View File

@ -47,7 +47,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
DriverId = device.DriverId,
Description = device.Description,
DeviceTypeEnum = device.DeviceTypeEnum,
Parent= device.Parent
Parent = device.Parent
};
DC.Set<Device>().Add(newDevice);
devices.Add(newDevice);
@ -67,7 +67,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
DC.Set<DeviceConfig>().Add(newDeviceConfig);
}
foreach (var deviceVariable in deviceVariables)
foreach (var deviceVariable in deviceVariables.OrderBy(x => x.Index))
{
var newDeviceVariable = new DeviceVariable
{
@ -75,10 +75,13 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
Name = deviceVariable.Name,
Description = deviceVariable.Description,
DataType = deviceVariable.DataType,
IsTrigger = deviceVariable.IsTrigger,
Method = deviceVariable.Method,
ProtectType = deviceVariable.ProtectType,
Expressions = deviceVariable.Expressions,
DeviceAddress = deviceVariable.DeviceAddress
DeviceAddress = deviceVariable.DeviceAddress,
Index = deviceVariable.Index,
IsUpload = deviceVariable.IsUpload
};
DC.Set<DeviceVariable>().Add(newDeviceVariable);

View File

@ -38,8 +38,10 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
var dapConfigs = DC.Set<DeviceConfig>().Where(x => x.DeviceId == dap.ID).ToList();
var dapVariables = DC.Set<DeviceVariable>().Where(x => x.DeviceId == dap.ID).ToList();
var rpcs = DC.Set<RpcLog>().Where(x => x.DeviceId == dap.ID).ToList();
DC.Set<DeviceConfig>().RemoveRange(dapConfigs);
DC.Set<DeviceVariable>().RemoveRange(dapVariables);
DC.Set<RpcLog>().RemoveRange(rpcs);
}
pluginManager.RemoveDeviceThread(dap);
}

View File

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
public partial class DeviceApiBatchVM : BaseBatchVM<Device, DeviceApi_BatchEdit>
{
public DeviceApiBatchVM()
{
ListVM = new DeviceApiListVM();
LinkedVM = new DeviceApi_BatchEdit();
}
}
/// <summary>
/// Class to define batch edit fields
/// </summary>
public class DeviceApi_BatchEdit : BaseVM
{
[Display(Name = "AutoStart")]
public Boolean? AutoStart { get; set; }
[Display(Name = "ChangeUpload")]
public Boolean? CgUpload { get; set; }
[Display(Name = "EnforcePeriodms")]
public UInt32? EnforcePeriod { get; set; }
[Display(Name = "CmdPeriodms")]
public UInt32? CmdPeriod { get; set; }
protected override void InitVM()
{
}
}
}

View File

@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
public partial class DeviceApiTemplateVM : BaseTemplateVM
{
[Display(Name = "DeviceName")]
public ExcelPropety DeviceName_Excel = ExcelPropety.CreateProperty<Device>(x => x.DeviceName);
[Display(Name = "Sort")]
public ExcelPropety Index_Excel = ExcelPropety.CreateProperty<Device>(x => x.Index);
[Display(Name = "Description")]
public ExcelPropety Description_Excel = ExcelPropety.CreateProperty<Device>(x => x.Description);
public ExcelPropety Driver_Excel = ExcelPropety.CreateProperty<Device>(x => x.DriverId);
[Display(Name = "AutoStart")]
public ExcelPropety AutoStart_Excel = ExcelPropety.CreateProperty<Device>(x => x.AutoStart);
[Display(Name = "ChangeUpload")]
public ExcelPropety CgUpload_Excel = ExcelPropety.CreateProperty<Device>(x => x.CgUpload);
[Display(Name = "EnforcePeriodms")]
public ExcelPropety EnforcePeriod_Excel = ExcelPropety.CreateProperty<Device>(x => x.EnforcePeriod);
[Display(Name = "CmdPeriodms")]
public ExcelPropety CmdPeriod_Excel = ExcelPropety.CreateProperty<Device>(x => x.CmdPeriod);
[Display(Name = "Type")]
public ExcelPropety DeviceTypeEnum_Excel = ExcelPropety.CreateProperty<Device>(x => x.DeviceTypeEnum);
[Display(Name = "_Admin.Parent")]
public ExcelPropety Parent_Excel = ExcelPropety.CreateProperty<Device>(x => x.ParentId);
protected override void InitVM()
{
Driver_Excel.DataType = ColumnDataType.ComboBox;
Driver_Excel.ListItems = DC.Set<Driver>().GetSelectListItems(Wtm, y => y.DriverName);
Parent_Excel.DataType = ColumnDataType.ComboBox;
Parent_Excel.ListItems = DC.Set<Device>().GetSelectListItems(Wtm, y => y.DeviceName);
}
}
public class DeviceApiImportVM : BaseImportVM<DeviceApiTemplateVM, Device>
{
}
}

View File

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using IoTGateway.Model;
namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
public partial class DeviceApiListVM : BasePagedListVM<DeviceApi_View, DeviceApiSearcher>
{
protected override IEnumerable<IGridColumn<DeviceApi_View>> InitGridHeader()
{
return new List<GridColumn<DeviceApi_View>>{
this.MakeGridHeader(x => x.DeviceName),
this.MakeGridHeader(x => x.Index),
this.MakeGridHeader(x => x.Description),
this.MakeGridHeader(x => x.DriverName_view),
this.MakeGridHeader(x => x.AutoStart),
this.MakeGridHeader(x => x.CgUpload),
this.MakeGridHeader(x => x.EnforcePeriod),
this.MakeGridHeader(x => x.CmdPeriod),
this.MakeGridHeader(x => x.DeviceTypeEnum),
this.MakeGridHeader(x => x.DeviceName_view),
this.MakeGridHeaderAction(width: 200)
};
}
public override IOrderedQueryable<DeviceApi_View> GetSearchQuery()
{
var query = DC.Set<Device>()
.CheckContain(Searcher.DeviceName, x=>x.DeviceName)
.CheckEqual(Searcher.DriverId, x=>x.DriverId)
.Select(x => new DeviceApi_View
{
ID = x.ID,
DeviceName = x.DeviceName,
Index = x.Index,
Description = x.Description,
DriverName_view = x.Driver.DriverName,
AutoStart = x.AutoStart,
CgUpload = x.CgUpload,
EnforcePeriod = x.EnforcePeriod,
CmdPeriod = x.CmdPeriod,
DeviceTypeEnum = x.DeviceTypeEnum,
DeviceName_view = x.Parent.DeviceName,
})
.OrderBy(x => x.ID);
return query;
}
}
public class DeviceApi_View : Device{
[Display(Name = "DriverName")]
public String DriverName_view { get; set; }
[Display(Name = "DeviceName")]
public String DeviceName_view { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
public partial class DeviceApiSearcher : BaseSearcher
{
[Display(Name = "DeviceName")]
public String DeviceName { get; set; }
public Guid? DriverId { get; set; }
protected override void InitVM()
{
}
}
}

View File

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
public partial class DeviceApiVM : BaseCRUDVM<Device>
{
public DeviceApiVM()
{
SetInclude(x => x.Driver);
SetInclude(x => x.Parent);
}
protected override void InitVM()
{
}
public override void DoAdd()
{
base.DoAdd();
}
public override void DoEdit(bool updateAllFields = false)
{
base.DoEdit(updateAllFields);
}
public override void DoDelete()
{
base.DoDelete();
}
}
}

View File

@ -18,10 +18,10 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
return new List<GridAction>
{
this.MakeAction("Device","Copy","设备复制","设备复制", GridActionParameterTypesEnum.SingleId,"BasicData",600).SetIconCls("layui-icon layui-icon-template-1").SetPromptMessage("你确定复制设备,包括配置参数和变量?").SetDialogTitle("复制设备确认").SetHideOnToolBar(true).SetShowInRow(true).SetBindVisiableColName("copy"),
this.MakeAction("Device","Attribute","请求属性","请求属性", GridActionParameterTypesEnum.SingleId,"BasicData",600).SetIconCls("layui-icon layui-icon-download-circle").SetPromptMessage("你确定请求客户端属性和共享属性吗?").SetDialogTitle("请求属性确认").SetHideOnToolBar(true).SetShowInRow(true).SetBindVisiableColName("attribute"),
this.MakeAction("Device","CreateGroup","创建组","创建组", GridActionParameterTypesEnum.NoId,"BasicData",600).SetIconCls("_wtmicon _wtmicon-zuzhiqunzu").SetDialogTitle("创建组").SetShowInRow(false),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.Create, "创建设备","BasicData", dialogWidth: 800,name:"创建设备").SetIconCls("layui-icon layui-icon-senior"),
this.MakeAction("Device","Copy",Localizer["CopyDevice"],Localizer["CopyDevice"], GridActionParameterTypesEnum.SingleId,"BasicData",600).SetIconCls("layui-icon layui-icon-template-1").SetPromptMessage("你确定复制设备,包括配置参数和变量?").SetDialogTitle(Localizer["CopyDevice"]).SetHideOnToolBar(true).SetShowInRow(true).SetBindVisiableColName("copy"),
this.MakeAction("Device","Attribute",Localizer["RequestAttribute"],Localizer["RequestAttribute"], GridActionParameterTypesEnum.SingleId,"BasicData",600).SetIconCls("layui-icon layui-icon-download-circle").SetPromptMessage("你确定请求客户端属性和共享属性吗?").SetDialogTitle(Localizer["RequestAttribute"]).SetHideOnToolBar(true).SetShowInRow(true).SetBindVisiableColName("attribute"),
this.MakeAction("Device","CreateGroup",Localizer["CreateGroup"],Localizer["CreateGroup"], GridActionParameterTypesEnum.NoId,"BasicData",600).SetIconCls("_wtmicon _wtmicon-zuzhiqunzu").SetDialogTitle(Localizer["CreateGroup"]).SetShowInRow(false),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.Create, Localizer["CreateDevice"],"BasicData", dialogWidth: 800,name:Localizer["CreateDevice"]).SetIconCls("layui-icon layui-icon-senior"),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "BasicData", dialogWidth: 800),
@ -29,6 +29,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
this.MakeStandardAction("Device", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "BasicData", dialogWidth: 800),
//this.MakeStandardAction("Device", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "BasicData"),
this.MakeAction("Device","ImportExcel",Localizer["ImportExcel"],Localizer["ImportExcel"], GridActionParameterTypesEnum.NoId,"BasicData",600).SetIconCls("layui-icon layui-icon-upload-circle").SetDialogTitle(Localizer["ImportExcel"]).SetHideOnToolBar(false).SetShowInRow(false),
};
}
@ -36,15 +37,15 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
protected override IEnumerable<IGridColumn<Device_View>> InitGridHeader()
{
return new List<GridColumn<Device_View>>{
this.MakeGridHeader(x => x.DeviceName),
this.MakeGridHeader(x => x.Index),
this.MakeGridHeader(x => x.DeviceName).SetWidth(150),
this.MakeGridHeader(x => x.Index).SetWidth(60),
//this.MakeGridHeader(x => x.Description),
this.MakeGridHeader(x => x.DriverName_view),
this.MakeGridHeader(x => x.AutoStart),
this.MakeGridHeader(x => x.CgUpload),
this.MakeGridHeader(x => x.EnforcePeriod),
this.MakeGridHeader(x => x.CmdPeriod),
this.MakeGridHeader(x => x.DeviceTypeEnum),
this.MakeGridHeader(x => x.DriverName_view).SetWidth(150),
this.MakeGridHeader(x => x.AutoStart).SetWidth(80),
this.MakeGridHeader(x => x.CgUpload).SetWidth(100),
this.MakeGridHeader(x => x.EnforcePeriod).SetWidth(110),
this.MakeGridHeader(x => x.CmdPeriod).SetWidth(110),
this.MakeGridHeader(x => x.DeviceTypeEnum).SetWidth(80),
//this.MakeGridHeader(x => x.DeviceName_view),
this.MakeGridHeader(x=>"copy").SetHide().SetFormat((a,b)=>{
if(a.DeviceTypeEnum== DeviceTypeEnum.Device)
@ -102,7 +103,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
AutoStart = y.AutoStart,
CgUpload = y.CgUpload,
EnforcePeriod = y.EnforcePeriod,
CmdPeriod=y.CmdPeriod,
CmdPeriod = y.CmdPeriod,
Description = y.Description,
DeviceTypeEnum = y.DeviceTypeEnum,
DriverName_view = y.Driver?.DriverName,
@ -121,9 +122,9 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
public class Device_View : Device
{
[Display(Name = "驱动名")]
[Display(Name = "DriverName")]
public String DriverName_view { get; set; }
[Display(Name = "父级名")]
[Display(Name = "GroupName")]
public String DeviceName_view { get; set; }
public int ExtraOrder { get; set; }
}

View File

@ -22,8 +22,8 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
protected override void InitVM()
{
AllDrivers = DC.Set<Driver>().GetSelectListItems(Wtm, y => y.DriverName);
AllParents = DC.Set<Device>().Where(x=>x.DeviceTypeEnum== DeviceTypeEnum.Group).GetSelectListItems(Wtm, y => y.DeviceName);
AllDrivers = DC.Set<Driver>().GetSelectListItems(Wtm, y => y.FileName);
AllParents = DC.Set<Device>().Where(x => x.DeviceTypeEnum == DeviceTypeEnum.Group).GetSelectListItems(Wtm, y => y.DeviceName);
}
public override void DoAdd()
@ -36,11 +36,11 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
deviceService.DrvierManager.AddConfigs(this.Entity.ID, this.Entity.DriverId);
var device = DC.Set<Device>().Where(x => x.ID == Entity.ID).Include(x=>x.Parent).Include(x => x.Driver).SingleOrDefault();
var device = DC.Set<Device>().Where(x => x.ID == Entity.ID).Include(x => x.Parent).Include(x => x.Driver).Include(x => x.DeviceVariables).SingleOrDefault();
deviceService.CreateDeviceThread(device);
var myMqttClient = Wtm.ServiceProvider.GetService(typeof(MyMqttClient)) as MyMqttClient;
myMqttClient.DeviceAdded(device);
var messageService = Wtm.ServiceProvider.GetService(typeof(MessageService)) as MessageService;
messageService.DeviceAdded(device);
}
}
catch (Exception ex)
@ -62,8 +62,8 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
List<Guid> Ids = new List<Guid>() { Guid.Parse(FC["id"].ToString()) };
var pluginManager = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
var myMqttClient = Wtm.ServiceProvider.GetService(typeof(MyMqttClient)) as MyMqttClient;
myMqttClient.DeviceDeleted(Entity);
var messageService = Wtm.ServiceProvider.GetService(typeof(MessageService)) as MessageService;
messageService.DeviceDeleted(Entity);
var ret = DeleteDevices.doDelete(pluginManager, DC, Ids);
if (!ret.IsSuccess)
{

View File

@ -8,6 +8,7 @@ using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
using PluginInterface;
using Plugin;
using Microsoft.Extensions.Primitives;
namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
{
@ -21,10 +22,15 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public override bool DoBatchDelete()
{
//先获取id
var id = UpdateDevices.FC2Guids(FC);
var deviceId = DC.Set<DeviceVariable>().Where(x => id.Contains(x.ID)).Select(x => x.DeviceId).FirstOrDefault();
FC["Entity.DeviceId"] = (StringValues)deviceId.ToString();
var ret = base.DoBatchDelete();
if (ret)
{
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
UpdateDevices.UpdateVaribale(DC, deviceService, FC);
}
return ret;
@ -53,10 +59,14 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public String DeviceAddress { get; set; }
[Display(Name = "数据类型")]
public DataTypeEnum? DataType { get; set; }
[Display(Name = "大小端")]
public EndianEnum? EndianType { get; set; }
[Display(Name = "表达式")]
public string Expression { get; set; }
public string Expressions { get; set; }
[Display(Name = "权限")]
public ProtectTypeEnum? ProtectType { get; set; }
[Display(Name = "设备别名")]
public String Alias { get; set; }
protected override void InitVM()
{

View File

@ -6,6 +6,8 @@ using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
using Microsoft.Extensions.Primitives;
using Plugin;
using PluginInterface;
@ -25,11 +27,19 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public ExcelPropety DeviceAddress_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.DeviceAddress);
[Display(Name = "数据类型")]
public ExcelPropety DataType_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.DataType);
[Display(Name = "触发")]
public ExcelPropety IsTrigger_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.IsTrigger);
[Display(Name = "大小端")]
public ExcelPropety EndianType_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.EndianType);
[Display(Name = "表达式")]
public ExcelPropety Expressions_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.Expressions);
[Display(Name = "上传")]
public ExcelPropety IsUpload_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.IsUpload);
[Display(Name = "权限")]
public ExcelPropety ProtectType_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.ProtectType);
public ExcelPropety Device_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.DeviceId);
[Display(Name = "设备别名")]
public ExcelPropety Alias_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.Alias);
protected override void InitVM()
{
@ -40,7 +50,16 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public class DeviceVariableImportVM : BaseImportVM<DeviceVariableTemplateVM, DeviceVariable>
{
public override bool BatchSaveData()
{
var result = base.BatchSaveData();
FC["Ids"] = new StringValues(EntityList.Select(x => x.DeviceId.ToString()).ToArray());
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
UpdateDevices.UpdateDevice(DC, deviceService, FC);
return result;
}
}
}

View File

@ -10,6 +10,7 @@ using IoTGateway.Model;
using PluginInterface;
using Plugin;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
{
@ -21,7 +22,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
{
return new List<GridAction>
{
this.MakeAction("DeviceVariable","SetValue","写入值","写入值", GridActionParameterTypesEnum.MultiIds,"BasicData",600).SetIconCls("_wtmicon _wtmicon-xiayibu").SetHideOnToolBar(false).SetShowInRow(false).SetBindVisiableColName("setValue"),
this.MakeAction("DeviceVariable","SetValue",Localizer["WriteValue"],Localizer["WriteValue"], GridActionParameterTypesEnum.MultiIds,"BasicData",600).SetIconCls("_wtmicon _wtmicon-xiayibu").SetHideOnToolBar(false).SetShowInRow(false).SetBindVisiableColName("setValue"),
this.MakeStandardAction("DeviceVariable", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceVariable", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceVariable", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "BasicData", dialogWidth: 800),
@ -41,20 +42,24 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
.GetTreeSelectListItems(Wtm, x => x.DeviceName);
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
foreach (var device in AllDevices)
Parallel.ForEach(AllDevices, device =>
{
foreach (var item in device.Children)
Parallel.ForEach(device.Children, item =>
{
var deviceThread = deviceService.DeviceThreads.Where(x => x.Device.ID.ToString() == (string)item.Value).FirstOrDefault();
var deviceThread = deviceService.DeviceThreads.FirstOrDefault(x => x.Device.ID.ToString() == (string)item.Value);
if (deviceThread != null)
item.Icon = deviceThread.Device.AutoStart ? (deviceThread.Driver.IsConnected ? "layui-icon layui-icon-link" : "layui-icon layui-icon-unlink") : "layui-icon layui-icon-pause";
item.Icon = deviceThread.Device.AutoStart
? (deviceThread.Driver.IsConnected
? "layui-icon layui-icon-link"
: "layui-icon layui-icon-unlink")
: "layui-icon layui-icon-pause";
item.Text = " " + item.Text;
item.Expended = true;
item.Selected = item.Value.ToString() == IoTBackgroundService.VariableSelectDeviceId.ToString();
}
}
});
});
DevicesTree = GetLayuiTree(AllDevices);
base.InitListVM();
}
@ -63,21 +68,31 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
return new List<GridColumn<DeviceVariable_View>>{
this.MakeGridHeader(x => x.Name).SetSort(true).SetWidth(100),
//this.MakeGridHeader(x => x.Description),
this.MakeGridHeader(x => x.Method).SetSort(true).SetWidth(160),
this.MakeGridHeader(x => x.DeviceAddress).SetSort(true).SetWidth(80),
this.MakeGridHeader(x => x.DataType).SetSort(true).SetWidth(80),
this.MakeGridHeader(x => x.Value).SetWidth(80).SetFormat((a,b)=>{
this.MakeGridHeader(x => x.Method).SetSort(true).SetWidth(130),
this.MakeGridHeader(x => x.DeviceAddress).SetSort(true).SetWidth(100),
this.MakeGridHeader(x => x.DataType).SetSort(true).SetWidth(75),
this.MakeGridHeader(x => x.IsTrigger).SetWidth(90),
this.MakeGridHeader(x => x.EndianType).SetSort(true).SetWidth(90),
this.MakeGridHeader(x => x.Value).SetWidth(95).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_Value'>{a.Value}</div>";
}),
this.MakeGridHeader(x => x.CookedValue).SetWidth(80).SetFormat((a,b)=>{
this.MakeGridHeader(x => x.CookedValue).SetWidth(95).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_CookedValue'>{a.CookedValue}</div>";
}),
this.MakeGridHeader(x => x.State).SetWidth(80).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_State'>{a.State}</div>";
this.MakeGridHeader(x => x.StatusType).SetWidth(75).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_State'>{a.StatusType}</div>";
}),
this.MakeGridHeader(x => x.Expressions).SetWidth(150),
//this.MakeGridHeader(x => x.ProtectType).SetSort(true),
this.MakeGridHeader(x => x.IsUpload).SetWidth(80),
this.MakeGridHeader(x => x.ProtectType).SetWidth(80).SetSort(true),
this.MakeGridHeader(x => x.DeviceName_view).SetSort(true).SetWidth(90),
this.MakeGridHeader(x => x.Alias).SetSort(true).SetWidth(90),
this.MakeGridHeader(x => x.Timestamp).SetWidth(100).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_Timestamp'>{a.Timestamp:HH:mm:ss.fff}</div>";
}),
this.MakeGridHeader(x => x.Message).SetSort(true).SetWidth(200).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_Message'>{a.Message}</div>";
}),
this.MakeGridHeader(x=> "detail").SetHide().SetFormat((a,b)=>{
return "false";
}),
@ -90,28 +105,59 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
};
}
public override void AfterDoSearcher()
{
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
foreach (var item in EntityList)
{
var DapThread = deviceService.DeviceThreads.Where(x => x.Device.ID == item.DeviceId).FirstOrDefault();
if (DapThread?.DeviceValues != null && DapThread.DeviceValues.ContainsKey(item.ID))
{
item.Value = DapThread?.DeviceValues[item.ID]?.Value?.ToString();
item.CookedValue = DapThread?.DeviceValues[item.ID]?.CookedValue?.ToString();
item.State = DapThread?.DeviceValues[item.ID]?.StatusType.ToString();
}
}
}
public override IOrderedQueryable<DeviceVariable_View> GetSearchQuery()
{
if (Searcher.DeviceId != null)
IoTBackgroundService.VariableSelectDeviceId = Searcher.DeviceId;
var query = DC.Set<DeviceVariable>().Include(x => x.Device)
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
//设备线程中的所有设备
var threadDeviceIds = deviceService?.DeviceThreads.Select(x => x.Device.ID).Distinct(x => x);
//设备线程中的变量
var threadVariables =
deviceService?.DeviceThreads.Where(x => x.Device.DeviceVariables != null).SelectMany(deviceThread => deviceThread.Device.DeviceVariables);
//查找数据库中额外的变量
var dcVariables = DC.Set<DeviceVariable>().AsNoTracking().Include(x => x.Device)
.Where(x => !threadDeviceIds.Contains((Guid)x.DeviceId)).AsEnumerable();
var variables = dcVariables.Union(threadVariables).AsQueryable();
if (SearcherMode == ListVMSearchModeEnum.Batch)
{
var ids = UpdateDevices.FC2Guids(FC);
return variables.Where(x => ids.Contains(x.ID)).Select(x => new DeviceVariable_View
{
ID = x.ID,
DeviceId = x.DeviceId,
Name = x.Name,
Index = x.Index,
Description = x.Description,
Method = x.Method,
DeviceAddress = x.DeviceAddress,
DataType = x.DataType,
IsTrigger = x.IsTrigger,
EndianType = x.EndianType,
Expressions = x.Expressions,
IsUpload = x.IsUpload,
ProtectType = x.ProtectType,
DeviceName_view = x.Device.DeviceName,
Alias = x.Alias,
Device = x.Device,
Value = x.Value,
CookedValue = x.CookedValue,
StatusType = x.StatusType,
Timestamp = x.Timestamp,
Message = x.Message,
})
.OrderBy(x => x.Index).ThenBy(x => x.DeviceName_view).ThenBy(x => x.Alias).ThenBy(x => x.Method)
.ThenBy(x => x.DeviceAddress);
}
return variables
.CheckContain(Searcher.Name, x => x.Name)
.CheckContain(Searcher.Alias, x => x.Alias)
.CheckContain(Searcher.Method, x => x.Method)
.CheckContain(Searcher.DeviceAddress, x => x.DeviceAddress)
.CheckEqual(Searcher.DataType, x => x.DataType)
@ -126,13 +172,27 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
Method = x.Method,
DeviceAddress = x.DeviceAddress,
DataType = x.DataType,
IsTrigger = x.IsTrigger,
EndianType = x.EndianType,
Expressions = x.Expressions,
IsUpload = x.IsUpload,
ProtectType = x.ProtectType,
DeviceName_view = x.Device.DeviceName,
Device = x.Device
Alias = x.Alias,
Device = x.Device,
Value = x.Value,
CookedValue = x.CookedValue,
StatusType = x.StatusType,
Timestamp = x.Timestamp,
Message = x.Message,
})
.OrderBy(x => x.DeviceName_view).ThenBy(x => x.Index);
return query;
.OrderBy(x => x.Index).ThenBy(x => x.DeviceName_view).ThenBy(x => x.Alias).ThenBy(x => x.Method)
.ThenBy(x => x.DeviceAddress);
}
public override IOrderedQueryable<DeviceVariable_View> GetBatchQuery()
{
return GetSearchQuery();
}
private List<LayuiTreeItem> GetLayuiTree(List<TreeSelectListItem> tree, int level = 0)
@ -193,14 +253,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public class DeviceVariable_View : DeviceVariable
{
[Display(Name = "设备名")]
public String DeviceName_view { get; set; }
[Display(Name = "原值")]
public String Value { get; set; }
[Display(Name = "值")]
public String CookedValue { get; set; }
[Display(Name = "状态")]
public String State { get; set; }
[Display(Name = "DeviceName")]
public string DeviceName_view { get; set; }
}
}

View File

@ -24,6 +24,8 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public List<ComboSelectListItem> AllDevices { get; set; }
[Display(Name = "设备名")]
public Guid? DeviceId { get; set; }
[Display(Name = "设备别名")]
public String Alias { get; set; }
protected override void InitVM()
{

View File

@ -3,12 +3,14 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using IoTGateway.DataAccess.Migrations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
using Plugin;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Primitives;
using PluginInterface;
namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
{
@ -24,6 +26,11 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
protected override void InitVM()
{
if (this.ControllerName.ToLower().Contains("add"))
{
this.Entity.IsUpload = true;
this.Entity.ProtectType = ProtectTypeEnum.ReadWrite;
}
AllDevices = DC.Set<Device>().AsNoTracking().Where(x => x.DeviceTypeEnum == DeviceTypeEnum.Device)
.OrderBy(x => x.Parent.Index).ThenBy(x => x.Parent.DeviceName)
.OrderBy(x => x.Index).ThenBy(x => x.DeviceName)
@ -74,7 +81,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
}
public override DuplicatedInfo<DeviceVariable> SetDuplicatedCheck()
{
var rv = CreateFieldsInfo(SimpleField(x => x.DeviceId), SimpleField(x => x.Name));
var rv = CreateFieldsInfo(SimpleField(x => x.DeviceId), SimpleField(x => x.Name), SimpleField(x => x.Alias));
return rv;
}
}

View File

@ -22,7 +22,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
{
try
{
StringValues ids , values;
StringValues ids, values;
if (FC.ContainsKey("setValue.ID[]"))
{
ids = (StringValues)FC["setValue.ID[]"];
@ -37,7 +37,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
Dictionary<string, string> kv = new(0);
for (int i = 0; i < ids.Count; i++)
{
kv[ids[i]]=values[i];
kv[ids[i]] = values[i];
}
@ -62,12 +62,16 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
string deviceName = dapThread.Device.DeviceName;
foreach (var variable in deviceVariables)
{
if (dapThread.DeviceValues.ContainsKey(variable.ID))
var currentVariable = dapThread!.Device.DeviceVariables.FirstOrDefault(x => x.ID == variable.ID);
if (currentVariable != null)
{
variable.DeviceName = deviceName;
variable.RawValue = dapThread.DeviceValues[variable.ID].Value?.ToString();
variable.Value = dapThread.DeviceValues[variable.ID].CookedValue?.ToString();
variable.Status = dapThread.DeviceValues[variable.ID].StatusType.ToString();
variable.DeviceName = deviceName + (!string.IsNullOrEmpty(variable.Alias)
? $"->{variable.Alias}"
: "");
variable.RawValue = currentVariable.Value?.ToString();
variable.Value = currentVariable.CookedValue?.ToString();
variable.Status = currentVariable.StatusType.ToString();
variable.SetRawValue = kv[variable.ID.ToString()];
}
}
@ -81,10 +85,10 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
};
dapThread.MyMqttClient_OnExcRpc(this, request);
}
}
}
= "设置成功";
= "下发完成请在Rpc日志页面查看结果";
}
catch (Exception ex)
{
@ -123,12 +127,13 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
string deviceName = dapThread.Device.DeviceName;
foreach (var variable in deviceVariables)
{
if (dapThread.DeviceValues.ContainsKey(variable.ID))
var currentVariable = dapThread!.Device.DeviceVariables.FirstOrDefault(x => x.ID == variable.ID);
if (currentVariable != null)
{
variable.DeviceName = deviceName;
variable.RawValue = dapThread.DeviceValues[variable.ID].Value?.ToString();
variable.Value = dapThread.DeviceValues[variable.ID].CookedValue?.ToString();
variable.Status = dapThread.DeviceValues[variable.ID].StatusType.ToString();
variable.RawValue = currentVariable.Value?.ToString();
variable.Value = currentVariable.CookedValue?.ToString();
variable.Status = currentVariable.StatusType.ToString();
}
}
}

View File

@ -52,7 +52,7 @@ namespace IoTGateway.ViewModel.BasicData.DriverVMs
AssembleName = x.AssembleName,
AuthorizesNum = x.AuthorizesNum,
})
.OrderBy(x => x.ID);
.OrderBy(x => x.FileName);
return query;
}

View File

@ -36,6 +36,13 @@ namespace IoTGateway.ViewModel.BasicData.DriverVMs
public override void DoEdit(bool updateAllFields = false)
{
var DriverService = Wtm.ServiceProvider.GetService(typeof(DriverService)) as DriverService;
Entity.AssembleName = DriverService.GetAssembleNameByFileName(Entity.FileName);
if (string.IsNullOrEmpty(Entity.AssembleName))
{
MSD.AddModelError("", "程序集获取失败");
return;
}
base.DoEdit(updateAllFields);
}

View File

@ -0,0 +1,306 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using IoTGateway.Model;
using PluginInterface;
using Plugin;
using Newtonsoft.Json;
using IoTGateway.DataAccess.Migrations;
using NPOI.HSSF.Util;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using IoTGateway.ViewModel.BasicData.DeviceVariableVMs;
using IoTGateway.ViewModel.BasicData.DeviceConfigVMs;
using System.IO;
using System.Reflection;
using IoTGateway.ViewModel.Config.SystemConfigVMs;
using IoTGateway.ViewModel.BasicData.DeviceVMs;
namespace IoTGateway.ViewModel.BasicData
{
public class ExportDevicesSetting : BaseVM
{
#region GetData
private List<Device> GetAllDevices()
{
var queryResult = DC.Set<Device>().AsNoTracking().AsNoTracking()
.Include(x => x.Parent).Include(x => x.Driver)
.OrderBy(x => x.ParentId).ToList();
return queryResult;
}
private List<DeviceConfig> GetAllDeviceConfigs()
{
var queryResult = DC.Set<DeviceConfig>().AsNoTracking().Include(x=>x.Device)
.OrderBy(x => x.Device.DeviceName).ThenBy(x => x.DeviceConfigName).ToList();
return queryResult;
}
private List<DeviceVariable> GetAllDeviceVariables()
{
var queryResult = DC.Set<DeviceVariable>().AsNoTracking().Include(x => x.Device)
.OrderBy(x => x.Device.DeviceName).ThenBy(x => x.Alias).ThenBy(x => x.Method).ThenBy(x => x.Index).ThenBy(x => x.DeviceAddress).ToList();
return queryResult;
}
private List<SystemConfig> GetAllSystemConfigs()
{
var queryResult = DC.Set<SystemConfig>().AsNoTracking()
.AsNoTracking()
.OrderBy(x => x.ID).ToList();
return queryResult;
}
#endregion
#region GenerateWorkSheet
private IWorkbook GenerateDevicesSheet(IWorkbook book, List<Device> devices)
{
if (book == null)
{
book = new XSSFWorkbook();
}
ISheet sheet = book.CreateSheet("设备维护");
int currentRow = 0;
#region
string[] colName = { "名称", "排序", "驱动名", "启动", "变化上传", "归档周期ms", "指令间隔ms", "类型" ,"所属组"};
IRow row = sheet.CreateRow(currentRow);
row.HeightInPoints = 20;
for (int i = 0; i < colName.Length; i++)
{
row.CreateCell(i).SetCellValue(colName[i]);
}
currentRow++;
#endregion
#region
foreach (var device in devices)
{
int currentCol = 0;
IRow rowData = sheet.CreateRow(currentRow);
rowData.CreateCell(currentCol).SetCellValue(device.DeviceName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.Index);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.Driver?.DriverName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.AutoStart);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.CgUpload);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.EnforcePeriod);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.CmdPeriod);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(PropertyHelper.GetEnumDisplayName(device.DeviceTypeEnum));
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.Parent?.DeviceName);
currentRow++;
}
#endregion
return book;
}
private IWorkbook GenerateDeviceConfigsSheet(IWorkbook book, List<DeviceConfig> deviceConfigs)
{
if (book == null)
{
book = new XSSFWorkbook();
}
ISheet sheet = book.CreateSheet("通讯配置");
int currentRow = 0;
#region
string[] colName = { "设备名", "名称", "属性侧", "描述", "值", "备注" };
IRow row = sheet.CreateRow(currentRow);
row.HeightInPoints = 20;
for (int i = 0; i < colName.Length; i++)
{
row.CreateCell(i).SetCellValue(colName[i]);
}
currentRow++;
#endregion
#region
foreach (var deviceConfig in deviceConfigs)
{
int currentCol = 0;
IRow rowData = sheet.CreateRow(currentRow);
rowData.CreateCell(currentCol).SetCellValue(deviceConfig.Device?.DeviceName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceConfig.DeviceConfigName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(PropertyHelper.GetEnumDisplayName(deviceConfig.DataSide));
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceConfig.Description);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceConfig.Value);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceConfig.EnumInfo);
currentRow++;
}
#endregion
return book;
}
private IWorkbook GenerateDeviceVariablesSheet(IWorkbook book, List<DeviceVariable> deviceVariables)
{
if (book == null)
{
book = new XSSFWorkbook();
}
ISheet sheet = book.CreateSheet("变量配置");
int currentRow = 0;
#region
string[] colName = { "设备名", "变量名", "方法", "地址", "类型", "大小端", "表达式", "别名","上传", "排序", "触发" };
IRow row = sheet.CreateRow(currentRow);
row.HeightInPoints = 20;
for (int i = 0; i < colName.Length; i++)
{
row.CreateCell(i).SetCellValue(colName[i]);
}
currentRow++;
#endregion
#region
foreach (var deviceVariable in deviceVariables)
{
int currentCol = 0;
IRow rowData = sheet.CreateRow(currentRow);
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Device.DeviceName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Name);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Method);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.DeviceAddress);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(PropertyHelper.GetEnumDisplayName(deviceVariable.DataType)); //deviceVariable.DataType.ToString();
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(PropertyHelper.GetEnumDisplayName(deviceVariable.EndianType));
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Expressions);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Alias);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.IsUpload);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Index);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.IsTrigger);
currentRow++;
}
#endregion
return book;
}
private IWorkbook GenerateSystemConfigSheet(IWorkbook book, List<SystemConfig> systemConfigs)
{
if (book == null)
{
book = new XSSFWorkbook();
}
ISheet sheet = book.CreateSheet("传输配置");
int currentRow = 0;
#region
string[] colName = { "网关名称", "ClientId", "输出平台", "Mqtt服务器", "Mqtt端口", "Mqtt用户名", "Mqtt密码" };
IRow row = sheet.CreateRow(currentRow);
row.HeightInPoints = 20;
for (int i = 0; i < colName.Length; i++)
{
row.CreateCell(i).SetCellValue(colName[i]);
}
currentRow++;
#endregion
#region
foreach (var systemConfig in systemConfigs)
{
int currentCol = 0;
IRow rowData = sheet.CreateRow(currentRow);
rowData.CreateCell(currentCol).SetCellValue(systemConfig.GatewayName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(systemConfig.ClientId);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(PropertyHelper.GetEnumDisplayName(systemConfig.IoTPlatformType));
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(systemConfig.MqttIp);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(systemConfig.MqttPort);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(systemConfig.MqttUName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(systemConfig.MqttUPwd);
currentRow++;
}
#endregion
return book;
}
#endregion
public byte[] Export()
{
byte[] result = null;
IWorkbook book = new XSSFWorkbook();
//Sheet1-设备维护
var allDevices = GetAllDevices();
book = GenerateDevicesSheet(book, allDevices);
//Sheet2-变量配置
var allDeviceVariables = GetAllDeviceVariables();
book = GenerateDeviceVariablesSheet(book, allDeviceVariables);
//Sheet3-通讯设置
var allDeviceConfigs = GetAllDeviceConfigs();
book = GenerateDeviceConfigsSheet(book, allDeviceConfigs);
//Sheet4-传输配置
var allSystemConfigs = GetAllSystemConfigs();
book = GenerateSystemConfigSheet(book, allSystemConfigs);
using MemoryStream ms = new MemoryStream();
book.Write(ms);
result = ms.ToArray();
return result;
}
}
}

View File

@ -0,0 +1,282 @@
using Microsoft.EntityFrameworkCore;
using Plugin;
using System;
using System.Collections.Generic;
using System.Linq;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.DependencyInjection;
using WalkingTec.Mvvm.Core.Support.FileHandlers;
using NPOI.XSSF.UserModel;
using NPOI.SS.UserModel;
using PluginInterface;
using IoTGateway.ViewModel.BasicData.DeviceVMs;
using Microsoft.Extensions.Logging;
namespace IoTGateway.ViewModel.BasicData
{
public class ImportExcelVM : BaseVM
{
[Display(Name = "全部覆盖")]
public bool Cover { get; set; }
public string { get; set; }
[Display(Name = "Excel模板文件")]
public Guid ExcelFileId { get; set; }
public FileAttachment ExcelFile { get; set; }
private List<Driver> _drivers;
private List<Device> _devices;
private List<DeviceVariable> _deviceVariables;
private Dictionary<string, DataTypeEnum> dateTypeNameMapping;
private Dictionary<string, EndianEnum> endianTypeNameMapping;
public void Import()
{
using var transaction = DC.BeginTransaction();
_drivers = DC.Set<Driver>().AsNoTracking().ToList();
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
try
{
var oldDevices = DC.Set<Device>().ToList();
if (true)//Cover
{
foreach (var device in oldDevices)
{
var dapConfigs = DC.Set<DeviceConfig>().Where(x => x.DeviceId == device.ID).ToList();
var dapVariables = DC.Set<DeviceVariable>().Where(x => x.DeviceId == device.ID).ToList();
var rpcs = DC.Set<RpcLog>().Where(x => x.DeviceId == device.ID).ToList();
//var dapGroups = DC.Set<VariableGroup>().Where(x => x.DeviceId == dap.ID).ToList();
DC.Set<DeviceConfig>().RemoveRange(dapConfigs);
DC.Set<DeviceVariable>().RemoveRange(dapVariables);
DC.Set<RpcLog>().RemoveRange(rpcs);
deviceService.RemoveDeviceThread(device);
}
DC.Set<Device>().RemoveRange(oldDevices);
DC.SaveChanges();
DeleteDevices.doDelete(deviceService, DC, oldDevices.Select(x => x.ID).ToList());
}
var fp = Wtm.ServiceProvider.GetRequiredService<WtmFileProvider>();
var file = fp.GetFile(ExcelFileId.ToString(), true, DC);
var xssfworkbook = new XSSFWorkbook(file.DataStream);
file.DataStream.Dispose();
//获取数据的Sheet页信息
var sheetDevice = xssfworkbook.GetSheet("设备维护");
var devices = GetDevices(sheetDevice);
DC.Set<Device>().AddRange(devices);
var sheetVariables = xssfworkbook.GetSheet("变量配置");
var deviceVariables = GetVariables(sheetVariables);
DC.Set<DeviceVariable>().AddRange(deviceVariables);
var sheetDeviceConfigs = xssfworkbook.GetSheet("通讯配置");
var deviceConfigs = GetDeviceConfigs(sheetDeviceConfigs);
DC.Set<DeviceConfig>().AddRange(deviceConfigs);
var sheetSystemConfig = xssfworkbook.GetSheet("传输配置");
var newSystemConfig = GetSystemConfig(sheetSystemConfig);
var systemConfig = DC.Set<SystemConfig>().First();
systemConfig.GatewayName = newSystemConfig.GatewayName;
systemConfig.ClientId = newSystemConfig.ClientId;
systemConfig.IoTPlatformType = newSystemConfig.IoTPlatformType;
systemConfig.MqttIp = newSystemConfig.MqttIp;
systemConfig.MqttPort = newSystemConfig.MqttPort;
systemConfig.MqttUName = newSystemConfig.MqttUName;
systemConfig.MqttUPwd = newSystemConfig.MqttUPwd;
DC.SaveChanges();
transaction.Commit();
var messageService = Wtm.ServiceProvider.GetService(typeof(MessageService)) as MessageService;
messageService.StartClientAsync().Wait();
//重新启动采集
deviceService.CreateDeviceThreads();
=
$"成功导入{devices.Count(x => x.DeviceTypeEnum == DeviceTypeEnum.Device)}个设备,{devices.Count(x => x.DeviceTypeEnum == DeviceTypeEnum.Group)}个组";
}
catch (Exception ex)
{
transaction.Rollback();
= $"导入失败,已经回滚。{ex}";
Console.WriteLine($"{导入结果},{ex.Message}");
}
}
private List<Device> GetDevices(ISheet sheetDevice)
{
var devices = new List<Device>();
for (int i = 1; i <= sheetDevice.LastRowNum; i++)
{
try
{
var row = sheetDevice.GetRow(i);
Device device = new Device();
device.ID = Guid.NewGuid();
device.DeviceName = row.GetCell(0)?.ToString();
device.Index = uint.Parse(row.GetCell(1)?.ToString());
device.ParentId = devices.FirstOrDefault(x => x.DeviceName == row.GetCell(8)?.ToString() && x.DeviceTypeEnum == DeviceTypeEnum.Group)?.ID;
device.DeviceTypeEnum = device.ParentId == null ? DeviceTypeEnum.Group : DeviceTypeEnum.Device;
if (device.DeviceTypeEnum == DeviceTypeEnum.Device)
{
device.DriverId = _drivers.FirstOrDefault(x => x.DriverName == row.GetCell(2)?.ToString())?.ID;
device.AutoStart = row.GetCell(3).BooleanCellValue;
device.CgUpload = row.GetCell(4).BooleanCellValue;
device.EnforcePeriod = uint.Parse(row.GetCell(5)?.ToString());
device.CmdPeriod = uint.Parse(row.GetCell(6)?.ToString());
}
devices.Add(device);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
_devices = devices;
return devices;
}
private List<DeviceVariable> GetVariables(ISheet sheet)
{
DateTypeNameMapping();
EndianNameMapping();
var deviceVariables = new List<DeviceVariable>();
for (int i = 1; i <= sheet.LastRowNum; i++)
{
try
{
var row = sheet.GetRow(i);
var variable = new DeviceVariable();
variable.ID = Guid.NewGuid();
variable.DeviceId = _devices.FirstOrDefault(x => x.DeviceName == row.GetCell(0)?.ToString())?.ID;
variable.Name = row.GetCell(1)?.ToString();
variable.Method = row.GetCell(2)?.ToString();
variable.DeviceAddress = row.GetCell(3)?.ToString();
variable.DataType = dateTypeNameMapping.ContainsKey(row.GetCell(4)?.ToString()) ? dateTypeNameMapping[row.GetCell(4)?.ToString()] : DataTypeEnum.Any;
variable.EndianType = endianTypeNameMapping.ContainsKey(row.GetCell(5)?.ToString()) ? endianTypeNameMapping[row.GetCell(5)?.ToString()] : EndianEnum.None;
variable.Expressions = row.GetCell(6)?.ToString();
variable.Alias = row.GetCell(7)?.ToString();
variable.IsUpload = row.GetCell(8)?.ToString().ToLower() == "false" ? false : true;
variable.Index = string.IsNullOrWhiteSpace(row.GetCell(9)?.ToString())
? 999
: uint.Parse(row.GetCell(9).ToString());
variable.IsTrigger = row.GetCell(10)?.ToString().ToLower() == "false" ? false : true;
deviceVariables.Add(variable);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
_deviceVariables = deviceVariables;
return deviceVariables;
}
private List<DeviceConfig> GetDeviceConfigs(ISheet sheet)
{
var deviceConfigs = new List<DeviceConfig>();
for (int i = 1; i <= sheet.LastRowNum; i++)
{
try
{
var row = sheet.GetRow(i);
var config = new DeviceConfig();
config.ID = Guid.NewGuid();
config.DeviceId = _devices.FirstOrDefault(x => x.DeviceName == row.GetCell(0)?.ToString())?.ID;
config.DeviceConfigName = row.GetCell(1)?.ToString();
config.DataSide = row.GetCell(2)?.ToString() == "共享属性" ? DataSide.AnySide : DataSide.ClientSide;
config.Description = row.GetCell(3)?.ToString();
config.Value = row.GetCell(4)?.ToString();
config.EnumInfo = row.GetCell(5)?.ToString();
deviceConfigs.Add(config);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
return deviceConfigs;
}
private SystemConfig GetSystemConfig(ISheet sheet)
{
var systemConfig = new SystemConfig();
for (int i = 1; i <= 1; i++)
{
try
{
var row = sheet.GetRow(i);
systemConfig.GatewayName = row.GetCell(0)?.ToString();
systemConfig.ClientId = row.GetCell(1)?.ToString();
systemConfig.IoTPlatformType = IoTPlatformType.IoTSharp;
systemConfig.MqttIp = row.GetCell(3)?.ToString();
systemConfig.MqttPort = int.Parse(row.GetCell(4)?.ToString());
systemConfig.MqttUName = row.GetCell(5)?.ToString();
systemConfig.MqttUPwd = row.GetCell(6)?.ToString();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
return systemConfig;
}
protected void DateTypeNameMapping()
{
dateTypeNameMapping = new Dictionary<string, DataTypeEnum>();
var enumType = typeof(DataTypeEnum);
var displayAttributeType = typeof(DisplayAttribute);
DataTypeEnum? found = null;
foreach (var name in Enum.GetNames(enumType))
{
var member = enumType.GetMember(name).First();
var displayAttrib = (DisplayAttribute)member.GetCustomAttributes(displayAttributeType, false).First();
dateTypeNameMapping.Add(displayAttrib.Name, (DataTypeEnum)Enum.Parse(enumType, name));
}
}
protected void EndianNameMapping()
{
endianTypeNameMapping = new Dictionary<string, EndianEnum>();
var enumType = typeof(EndianEnum);
var displayAttributeType = typeof(DisplayAttribute);
EndianEnum? found = null;
Enum.GetNames(enumType).ToList().ForEach(name =>
{
var member = enumType.GetMember(name).First();
var displayAttrib = (DisplayAttribute)member.GetCustomAttributes(displayAttributeType, false).First();
endianTypeNameMapping.Add(displayAttrib.Name, (EndianEnum)Enum.Parse(enumType, name));
});
}
}
}

View File

@ -29,8 +29,8 @@ namespace IoTGateway.ViewModel.Config.SystemConfigVMs
public override void DoEdit(bool updateAllFields = false)
{
base.DoEdit(updateAllFields);
var myMqttClient = Wtm.ServiceProvider.GetService(typeof(MyMqttClient)) as MyMqttClient;
myMqttClient.StartClientAsync().Wait();
var messageService = Wtm.ServiceProvider.GetService(typeof(MessageService)) as MessageService;
messageService.StartClientAsync().Wait();
}
public override void DoDelete()

View File

@ -67,34 +67,34 @@ namespace IoTGateway.ViewModel.MqttClient.MqttServerVMs
}
public class MqttClient_View : TopBasePoco
{
[Display(Name = "客户端Id")]
[Display(Name = "ClientId")]
public string ClientId { get; set; }
[Display(Name = "Endpoint")]
public string Endpoint { get; set; }
[Display(Name = "收消息数")]
[Display(Name = "RxMessages")]
public long ReceivedApplicationMessagesCount { get; set; }
[Display(Name = "收发消息数")]
[Display(Name = "TxMessages")]
public long SentApplicationMessagesCount { get; set; }
[Display(Name = "收包数")]
[Display(Name = "RxPackets")]
public long ReceivedPacketsCount { get; set; }
[Display(Name = "发包数")]
[Display(Name = "TxPackets")]
public long SentPacketsCount { get; set; }
[Display(Name = "发字节数")]
[Display(Name = "TxBytes")]
public long BytesSent { get; set; }
[Display(Name = "收字节数")]
[Display(Name = "RxBytes")]
public long BytesReceived { get; set; }
[Display(Name = "未决消息数")]
[Display(Name = "PendingMessage")]
public long PendingApplicationMessagesCount { get; set; }
[Display(Name = "协议版本")]
[Display(Name = "ProtocolVersion")]
public MqttProtocolVersion MqttProtocolVersion { get; set; }
}

View File

@ -38,7 +38,7 @@ namespace IoTGateway.ViewModel.Rpc.RpcLogVMs
this.MakeGridHeader(x => x.DeviceName_view),
this.MakeGridHeader(x => x.Method),
this.MakeGridHeader(x => x.Params),
this.MakeGridHeader(x => x.IsSuccess).SetHeader("是否成功"),
this.MakeGridHeader(x => x.IsSuccess),
this.MakeGridHeader(x => x.Description),
this.MakeGridHeaderAction(width: 200)
};
@ -92,9 +92,9 @@ namespace IoTGateway.ViewModel.Rpc.RpcLogVMs
public class RpcLog_View : RpcLog
{
[Display(Name = "设备名")]
[Display(Name = "DeviceName")]
public String DeviceName_view { get; set; }
[Display(Name = "持续时间(ms)")]
[Display(Name = "Duration(ms)")]
public double Duration { get; set; }
}

View File

@ -27,27 +27,45 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PluginInterface", "Plugins\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Drivers", "Drivers", "{D05CFF72-D58C-418A-8F52-B06848DAC4F1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverAllenBradley", "Plugins\Drivers\DriverAllenBradley\DriverAllenBradley.csproj", "{3106F31C-0502-42D3-A27B-BDD2199D72CC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PLC.ModBusMaster", "Plugins\Drivers\PLC.ModBusMaster\PLC.ModBusMaster.csproj", "{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverMitsubishi", "Plugins\Drivers\DriverMitsubishi\DriverMitsubishi.csproj", "{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CNC.Fanuc", "Plugins\Drivers\CNC.Fanuc\CNC.Fanuc.csproj", "{C7C873AE-1346-454F-B37C-F278524452EA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverModbusMaster", "Plugins\Drivers\DriverModbusMaster\DriverModbusMaster.csproj", "{8E2D91DC-DEE4-4843-8D09-6FC06651527E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PLC.AllenBradley", "Plugins\Drivers\PLC.AllenBradley\PLC.AllenBradley.csproj", "{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverMTConnect", "Plugins\Drivers\DriverMTConnect\DriverMTConnect.csproj", "{64D4C755-33DD-4103-908B-82FA63C5BFB2}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PLC", "PLC", "{1606D516-3865-4F57-9199-93091CF546F5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverOPCUaClient", "Plugins\Drivers\DriverOPCUaClient\DriverOPCUaClient.csproj", "{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Building", "Building", "{FFE700D9-F02F-4973-9D9E-0B370D00D5C1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverSiemensS7", "Plugins\Drivers\DriverSiemensS7\DriverSiemensS7.csproj", "{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CNC", "CNC", "{789C3203-3CE0-466C-A4F0-4B405406B94A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverOmronFins", "Plugins\Drivers\DriverOmronFins\DriverOmronFins.csproj", "{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Energy", "Energy", "{49BBB20D-6453-40C2-A9C7-F77DBCB95974}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverSimTcpClient", "Plugins\Drivers\DriverSimTcpClient\DriverSimTcpClient.csproj", "{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Other", "Other", "{912978D3-65E6-4029-ABEF-9673F3225605}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverFanucHsl", "Plugins\Drivers\DriverFanucHsl\DriverFanucHsl.csproj", "{10D22B6E-DE30-4F11-A005-8188DF549F72}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Other.Toledo", "Plugins\Drivers\Other.Toledo\Other.Toledo.csproj", "{22938881-111F-438C-8FE2-2053BD2C97AA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverFanuc", "Plugins\Drivers\DriverFanuc\DriverFanuc.csproj", "{41F81606-1728-4A03-AE64-FA2CCF49BE5A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CNC.Fanuc.H", "Plugins\Drivers\CNC.Fanuc.H\CNC.Fanuc.H.csproj", "{FBB004B6-2422-472B-AE5F-46CBE841EFF8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DriverOPCDaClient", "Plugins\Drivers\DriverOPCDaClient\DriverOPCDaClient.csproj", "{00FDB860-1A25-40D0-B29E-BAF2253713D6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PLC.MelsecMc", "Plugins\Drivers\PLC.MelsecMc\PLC.MelsecMc.csproj", "{35074354-AF67-468D-A0F3-4DA9000912D3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PLC.SiemensS7", "Plugins\Drivers\PLC.SiemensS7\PLC.SiemensS7.csproj", "{DACBF090-B59F-4962-9B93-B00F9E031F57}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CNC.MTConnect", "Plugins\Drivers\CNC.MTConnect\CNC.MTConnect.csproj", "{4CE60A0C-0B7D-49D6-880E-D28782693586}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PLC.OmronFins", "Plugins\Drivers\PLC.OmronFins\PLC.OmronFins.csproj", "{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OPC", "OPC", "{F8957F78-9D5D-4905-9EFC-EEEBA3A3A13F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OPC.DaClient", "Plugins\Drivers\OPC.DaClient\OPC.DaClient.csproj", "{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OPC.UaClient", "Plugins\Drivers\OPC.UaClient\OPC.UaClient.csproj", "{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mock", "Mock", "{87954B15-5C35-4454-AFC7-9DCE8066D5A0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mock.TcpClient", "Plugins\Drivers\Mock.TcpClient\Mock.TcpClient.csproj", "{1DE34C11-5461-442B-8C67-FCB0247C09D3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PLC.LSIS", "Plugins\Drivers\PLC.LS\PLC.LSIS.csproj", "{D3043673-283C-45D7-8F86-6BAAD89AF761}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -129,94 +147,110 @@ Global
{7752AD8C-04BF-4BD2-9272-CDA4F78FA954}.Release|Any CPU.Build.0 = Release|Any CPU
{7752AD8C-04BF-4BD2-9272-CDA4F78FA954}.Release|x86.ActiveCfg = Release|Any CPU
{7752AD8C-04BF-4BD2-9272-CDA4F78FA954}.Release|x86.Build.0 = Release|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Debug|x86.ActiveCfg = Debug|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Debug|x86.Build.0 = Debug|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Release|Any CPU.Build.0 = Release|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Release|x86.ActiveCfg = Release|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Release|x86.Build.0 = Release|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Debug|x86.ActiveCfg = Debug|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Debug|x86.Build.0 = Debug|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Release|Any CPU.Build.0 = Release|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Release|x86.ActiveCfg = Release|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Release|x86.Build.0 = Release|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Debug|x86.ActiveCfg = Debug|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Debug|x86.Build.0 = Debug|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Release|Any CPU.Build.0 = Release|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Release|x86.ActiveCfg = Release|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Release|x86.Build.0 = Release|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Debug|x86.ActiveCfg = Debug|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Debug|x86.Build.0 = Debug|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Release|Any CPU.Build.0 = Release|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Release|x86.ActiveCfg = Release|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Release|x86.Build.0 = Release|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Debug|x86.ActiveCfg = Debug|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Debug|x86.Build.0 = Debug|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Release|Any CPU.Build.0 = Release|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Release|x86.ActiveCfg = Release|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Release|x86.Build.0 = Release|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Debug|x86.ActiveCfg = Debug|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Debug|x86.Build.0 = Debug|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Release|Any CPU.Build.0 = Release|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Release|x86.ActiveCfg = Release|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Release|x86.Build.0 = Release|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Debug|x86.ActiveCfg = Debug|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Debug|x86.Build.0 = Debug|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Release|Any CPU.Build.0 = Release|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Release|x86.ActiveCfg = Release|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Release|x86.Build.0 = Release|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Debug|x86.ActiveCfg = Debug|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Debug|x86.Build.0 = Debug|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Release|Any CPU.Build.0 = Release|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Release|x86.ActiveCfg = Release|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Release|x86.Build.0 = Release|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Debug|x86.ActiveCfg = Debug|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Debug|x86.Build.0 = Debug|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Release|Any CPU.Build.0 = Release|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Release|x86.ActiveCfg = Release|x86
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Release|x86.Build.0 = Release|x86
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Debug|x86.ActiveCfg = Debug|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Debug|x86.Build.0 = Debug|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Release|Any CPU.Build.0 = Release|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Release|x86.ActiveCfg = Release|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Release|x86.Build.0 = Release|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Debug|x86.ActiveCfg = Debug|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Debug|x86.Build.0 = Debug|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Release|Any CPU.Build.0 = Release|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Release|x86.ActiveCfg = Release|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Release|x86.Build.0 = Release|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Debug|x86.ActiveCfg = Debug|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Debug|x86.Build.0 = Debug|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Release|Any CPU.Build.0 = Release|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Release|x86.ActiveCfg = Release|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Release|x86.Build.0 = Release|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Debug|x86.ActiveCfg = Debug|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Debug|x86.Build.0 = Debug|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Release|Any CPU.Build.0 = Release|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Release|x86.ActiveCfg = Release|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Release|x86.Build.0 = Release|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Debug|x86.ActiveCfg = Debug|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Debug|x86.Build.0 = Debug|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Release|Any CPU.Build.0 = Release|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Release|x86.ActiveCfg = Release|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Release|x86.Build.0 = Release|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Debug|x86.ActiveCfg = Debug|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Debug|x86.Build.0 = Debug|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Release|Any CPU.Build.0 = Release|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Release|x86.ActiveCfg = Release|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Release|x86.Build.0 = Release|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Debug|x86.ActiveCfg = Debug|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Debug|x86.Build.0 = Debug|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Release|Any CPU.Build.0 = Release|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Release|x86.ActiveCfg = Release|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Release|x86.Build.0 = Release|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Debug|x86.ActiveCfg = Debug|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Debug|x86.Build.0 = Debug|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Release|Any CPU.Build.0 = Release|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Release|x86.ActiveCfg = Release|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Release|x86.Build.0 = Release|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Debug|x86.ActiveCfg = Debug|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Debug|x86.Build.0 = Debug|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Release|Any CPU.Build.0 = Release|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Release|x86.ActiveCfg = Release|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Release|x86.Build.0 = Release|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Debug|x86.ActiveCfg = Debug|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Debug|x86.Build.0 = Debug|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Release|Any CPU.Build.0 = Release|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Release|x86.ActiveCfg = Release|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Release|x86.Build.0 = Release|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Debug|x86.ActiveCfg = Debug|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Debug|x86.Build.0 = Debug|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Release|Any CPU.Build.0 = Release|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Release|x86.ActiveCfg = Release|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Release|x86.Build.0 = Release|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Debug|x86.ActiveCfg = Debug|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Debug|x86.Build.0 = Debug|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Release|Any CPU.Build.0 = Release|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Release|x86.ActiveCfg = Release|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Release|x86.Build.0 = Release|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Debug|x86.ActiveCfg = Debug|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Debug|x86.Build.0 = Debug|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Release|Any CPU.Build.0 = Release|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Release|x86.ActiveCfg = Release|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Release|x86.Build.0 = Release|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Debug|x86.ActiveCfg = Debug|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Debug|x86.Build.0 = Debug|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Release|Any CPU.Build.0 = Release|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Release|x86.ActiveCfg = Release|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Release|x86.Build.0 = Release|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Debug|x86.ActiveCfg = Debug|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Debug|x86.Build.0 = Debug|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Release|Any CPU.Build.0 = Release|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Release|x86.ActiveCfg = Release|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -228,17 +262,26 @@ Global
{5C12EBFB-B152-48C6-AA52-71128F246594} = {2C665127-D9D0-445E-80A9-FD459673D454}
{7752AD8C-04BF-4BD2-9272-CDA4F78FA954} = {2C665127-D9D0-445E-80A9-FD459673D454}
{D05CFF72-D58C-418A-8F52-B06848DAC4F1} = {2C665127-D9D0-445E-80A9-FD459673D454}
{3106F31C-0502-42D3-A27B-BDD2199D72CC} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{8E2D91DC-DEE4-4843-8D09-6FC06651527E} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{64D4C755-33DD-4103-908B-82FA63C5BFB2} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{10D22B6E-DE30-4F11-A005-8188DF549F72} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{41F81606-1728-4A03-AE64-FA2CCF49BE5A} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{00FDB860-1A25-40D0-B29E-BAF2253713D6} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9} = {1606D516-3865-4F57-9199-93091CF546F5}
{C7C873AE-1346-454F-B37C-F278524452EA} = {789C3203-3CE0-466C-A4F0-4B405406B94A}
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7} = {1606D516-3865-4F57-9199-93091CF546F5}
{1606D516-3865-4F57-9199-93091CF546F5} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{FFE700D9-F02F-4973-9D9E-0B370D00D5C1} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{789C3203-3CE0-466C-A4F0-4B405406B94A} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{49BBB20D-6453-40C2-A9C7-F77DBCB95974} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{912978D3-65E6-4029-ABEF-9673F3225605} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{22938881-111F-438C-8FE2-2053BD2C97AA} = {912978D3-65E6-4029-ABEF-9673F3225605}
{FBB004B6-2422-472B-AE5F-46CBE841EFF8} = {789C3203-3CE0-466C-A4F0-4B405406B94A}
{35074354-AF67-468D-A0F3-4DA9000912D3} = {1606D516-3865-4F57-9199-93091CF546F5}
{DACBF090-B59F-4962-9B93-B00F9E031F57} = {1606D516-3865-4F57-9199-93091CF546F5}
{4CE60A0C-0B7D-49D6-880E-D28782693586} = {789C3203-3CE0-466C-A4F0-4B405406B94A}
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8} = {1606D516-3865-4F57-9199-93091CF546F5}
{F8957F78-9D5D-4905-9EFC-EEEBA3A3A13F} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4} = {F8957F78-9D5D-4905-9EFC-EEEBA3A3A13F}
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831} = {F8957F78-9D5D-4905-9EFC-EEEBA3A3A13F}
{87954B15-5C35-4454-AFC7-9DCE8066D5A0} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{1DE34C11-5461-442B-8C67-FCB0247C09D3} = {87954B15-5C35-4454-AFC7-9DCE8066D5A0}
{D3043673-283C-45D7-8F86-6BAAD89AF761} = {1606D516-3865-4F57-9199-93091CF546F5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1F219808-E6E8-4C1D-B846-41F2F7CF20FA}

View File

@ -0,0 +1,41 @@
using System.Linq;
using System.Threading.Tasks;
using IoTGateway.Model;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Plugin;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Mvc;
namespace IoTGateway.Areas.API
{
/// <summary>
/// 设备和数据查询api
/// </summary>
[Area("API")]
[ActionDescription("MenuKey.ActionLog")]
public class DeviceController : BaseController
{
private readonly ILogger<DeviceController> _logger;
private readonly DeviceService _deviceService;
public DeviceController(ILogger<DeviceController> logger, DeviceService deviceService)
{
_logger = logger;
_deviceService = deviceService;
}
/// <summary>
/// 获取设备列表
/// </summary>
/// <returns></returns>
[Public]
[HttpGet("Device/GetDevices")]
public async Task<IActionResult> GetDevices()
{
return Ok(await DC.Set<Device>().Include(x => x.Driver).Where(x => x.ParentId != null).AsNoTracking()
.OrderBy(x => x.Index).ToListAsync());
}
}
}

View File

@ -0,0 +1,180 @@
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using WalkingTec.Mvvm.Mvc;
using IoTGateway.ViewModel.BasicData.DeviceVMs;
using IoTGateway.Model;
namespace IoTGateway.Controllers
{
[Area("BasicData")]
[AuthorizeJwtWithCookie]
[ActionDescription("设备维护Api")]
[ApiController]
[Route("api/Device")]
public partial class DeviceApiController : BaseApiController
{
[ActionDescription("Sys.Search")]
[HttpPost("Search")]
public IActionResult Search(DeviceApiSearcher searcher)
{
if (ModelState.IsValid)
{
var vm = Wtm.CreateVM<DeviceApiListVM>(passInit: true);
vm.Searcher = searcher;
return Content(vm.GetJson());
}
else
{
return BadRequest(ModelState.GetErrorJson());
}
}
[ActionDescription("Sys.Get")]
[HttpGet("{id}")]
public DeviceApiVM Get(string id)
{
var vm = Wtm.CreateVM<DeviceApiVM>(id);
return vm;
}
[ActionDescription("Sys.Create")]
[HttpPost("Add")]
public IActionResult Add(DeviceApiVM vm)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState.GetErrorJson());
}
else
{
vm.DoAdd();
if (!ModelState.IsValid)
{
return BadRequest(ModelState.GetErrorJson());
}
else
{
return Ok(vm.Entity);
}
}
}
[ActionDescription("Sys.Edit")]
[HttpPut("Edit")]
public IActionResult Edit(DeviceApiVM vm)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState.GetErrorJson());
}
else
{
vm.DoEdit(false);
if (!ModelState.IsValid)
{
return BadRequest(ModelState.GetErrorJson());
}
else
{
return Ok(vm.Entity);
}
}
}
[HttpPost("BatchDelete")]
[ActionDescription("Sys.Delete")]
public IActionResult BatchDelete(string[] ids)
{
var vm = Wtm.CreateVM<DeviceApiBatchVM>();
if (ids != null && ids.Count() > 0)
{
vm.Ids = ids;
}
else
{
return Ok();
}
if (!ModelState.IsValid || !vm.DoBatchDelete())
{
return BadRequest(ModelState.GetErrorJson());
}
else
{
return Ok(ids.Count());
}
}
[ActionDescription("Sys.Export")]
[HttpPost("ExportExcel")]
public IActionResult ExportExcel(DeviceApiSearcher searcher)
{
var vm = Wtm.CreateVM<DeviceApiListVM>();
vm.Searcher = searcher;
vm.SearcherMode = ListVMSearchModeEnum.Export;
return vm.GetExportData();
}
[ActionDescription("Sys.CheckExport")]
[HttpPost("ExportExcelByIds")]
public IActionResult ExportExcelByIds(string[] ids)
{
var vm = Wtm.CreateVM<DeviceApiListVM>();
if (ids != null && ids.Count() > 0)
{
vm.Ids = new List<string>(ids);
vm.SearcherMode = ListVMSearchModeEnum.CheckExport;
}
return vm.GetExportData();
}
[ActionDescription("Sys.DownloadTemplate")]
[HttpGet("GetExcelTemplate")]
public IActionResult GetExcelTemplate()
{
var vm = Wtm.CreateVM<DeviceApiImportVM>();
var qs = new Dictionary<string, string>();
foreach (var item in Request.Query.Keys)
{
qs.Add(item, Request.Query[item]);
}
vm.SetParms(qs);
var data = vm.GenerateTemplate(out string fileName);
return File(data, "application/vnd.ms-excel", fileName);
}
[ActionDescription("Sys.Import")]
[HttpPost("Import")]
public ActionResult Import(DeviceApiImportVM vm)
{
if (vm!=null && (vm.ErrorListVM.EntityList.Count > 0 || !vm.BatchSaveData()))
{
return BadRequest(vm.GetErrorJson());
}
else
{
return Ok(vm?.EntityList?.Count ?? 0);
}
}
[HttpGet("GetDrivers")]
public ActionResult GetDrivers()
{
return Ok(DC.Set<Driver>().GetSelectListItems(Wtm, x => x.DriverName));
}
[HttpGet("GetDevices")]
public ActionResult GetDevices()
{
return Ok(DC.Set<Device>().GetSelectListItems(Wtm, x => x.DeviceName));
}
}
}

View File

@ -6,6 +6,7 @@ using WalkingTec.Mvvm.Mvc;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.ViewModel.BasicData.DeviceVMs;
using Plugin;
using IoTGateway.ViewModel.BasicData;
namespace IoTGateway.Controllers
{
@ -253,7 +254,17 @@ namespace IoTGateway.Controllers
[HttpPost]
public IActionResult ExportExcel(DeviceListVM vm)
{
return vm.GetExportData();
ExportDevicesSetting myExporter = new ExportDevicesSetting();
myExporter.DC = vm.DC;
var data = myExporter.Export();
string ContentType = "application/vnd.ms-excel";
string exportName = $"iotgateway.net_bakup_{DateTime.Now.ToString("yyyyMMddHHmmssffff")}.xlsx";
FileContentResult Result = new FileContentResult(data, ContentType);
Result.FileDownloadName = exportName;
return Result;
//return vm.GetExportData();
}
#region
@ -307,5 +318,30 @@ namespace IoTGateway.Controllers
{
return JsonMore(_DeviceService.GetDriverMethods(ID));
}
#region Excel
[ActionDescription("导入Excel")]
public ActionResult ImportExcel()
{
var vm = Wtm.CreateVM<ImportExcelVM>();
return PartialView(vm);
}
[HttpPost]
[ActionDescription("导入Excel")]
public ActionResult ImportExcel(ImportExcelVM vm)
{
if (!ModelState.IsValid)
{
return PartialView(vm);
}
else
{
vm.Import();
return FFResult().CloseDialog().RefreshGrid().Alert($"{vm.导入结果}");
}
}
#endregion
}
}

View File

@ -0,0 +1,18 @@
@model IoTGateway.ViewModel.BasicData.ImportExcelVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model" >
<wt:row items-per-row="ItemsPerRowEnum.One">
<wt:quote>导入会删除系统内所有设备</wt:quote>
</wt:row>
<wt:row items-per-row="ItemsPerRowEnum.Two">
@*<wt:switch field=Cover />*@
<wt:upload field="ExcelFileId" upload-type="ExcelFile"/>
</wt:row>
<wt:row align="AlignEnum.Right">
<wt:submitbutton text="导入" />
<wt:closebutton text="取消" />
</wt:row>
</wt:form>

View File

@ -3,7 +3,7 @@
<wt:form vm="@Model" height="400">
<wt:row items-per-row="ItemsPerRowEnum.Two">
@*<wt:textbox field="Entity.DeviceConfigName" />*@
<wt:textbox field="Entity.DeviceConfigName" />
@{
if (!string.IsNullOrEmpty(Model.Entity.EnumInfo))
{
@ -15,7 +15,7 @@
}
}
<wt:textbox field="Entity.Description" />
@*<wt:textbox field="Entity.EnumInfo" />*@
<wt:combobox field="Entity.DataSide" />
@*<wt:combobox field="Entity.DeviceId" items="AllDevices" />*@
</wt:row>
<wt:hidden field="Entity.ID" />

View File

@ -3,15 +3,17 @@
<wt:form vm="@Model">
<div style="margin-bottom:10px">@Localizer["Sys.BatchEditConfirm"] </div>
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="LinkedVM.Name" />
<wt:textbox field="LinkedVM.DeviceAddress" />
<wt:combobox field="LinkedVM.DataType" />
<wt:textbox field="LinkedVM.Expression" />
<wt:combobox field="LinkedVM.ProtectType" />
</wt:row>
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="LinkedVM.Name" />
<wt:textbox field="LinkedVM.DeviceAddress" />
<wt:combobox field="LinkedVM.DataType" />
<wt:combobox field="LinkedVM.EndianType" />
<wt:textbox field="LinkedVM.Expressions" />
<wt:combobox field="LinkedVM.ProtectType" />
<wt:textbox field="LinkedVM.Alias" />
</wt:row>
<wt:hidden field="Ids" />
<wt:grid vm="ListVM" use-local-data="true" height="300" hidden-checkbox="true" hidden-panel="true"/>
<wt:grid vm="ListVM" use-local-data="true" height="300" hidden-checkbox="true" hidden-panel="true" />
<wt:row align="AlignEnum.Right">
<wt:submitbutton />
<wt:closebutton />

View File

@ -10,8 +10,12 @@
<wt:combobox field="Entity.Method" items="AllMethods" required="true" />
<wt:textbox field="Entity.DeviceAddress" />
<wt:combobox field="Entity.DataType" />
<wt:textbox field="Entity.Expressions"/>
<wt:switch field="Entity.IsTrigger" />
<wt:combobox field="Entity.EndianType" />
<wt:textbox field="Entity.Expressions" />
<wt:switch field="Entity.IsUpload" />
<wt:combobox field="Entity.ProtectType" />
<wt:textbox field="Entity.Alias" />
</wt:row>
<wt:quote>表达式可以进行简单的数学计算,其中raw为原值参与计算</wt:quote>
<wt:row align="AlignEnum.Right">

View File

@ -9,6 +9,7 @@
<wt:display field="Entity.Method" />
<wt:display field="Entity.DeviceAddress" />
<wt:display field="Entity.DataType" />
<wt:display field="Entity.IsTrigger" />
<wt:display field="Entity.Expressions" />
<wt:display field="Entity.ProtectType" />
<wt:display field="Entity.Device.DeviceName" />

View File

@ -2,16 +2,19 @@
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.Name" />
<wt:display field="Entity.Description" />
<wt:display field="Entity.Method" />
<wt:display field="Entity.DeviceAddress" />
<wt:display field="Entity.DataType" />
<wt:display field="Entity.Expressions" />
<wt:display field="Entity.ProtectType" />
<wt:display field="Entity.Device.DeviceName" />
</wt:row>
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.Name" />
<wt:display field="Entity.Description" />
<wt:display field="Entity.Method" />
<wt:display field="Entity.DeviceAddress" />
<wt:display field="Entity.DataType" />
<wt:display field="Entity.IsTrigger" />
<wt:display field="Entity.EndianType" />
<wt:display field="Entity.Expressions" />
<wt:display field="Entity.ProtectType" />
<wt:display field="Entity.Device.DeviceName" />
<wt:display field="Entity.Alias" />
</wt:row>
<wt:row align="AlignEnum.Right">
<wt:closebutton />
</wt:row>

View File

@ -10,8 +10,12 @@
<wt:combobox field="Entity.Method" items=AllMethods />
<wt:textbox field="Entity.DeviceAddress" />
<wt:combobox field="Entity.DataType" />
<wt:switch field="Entity.IsTrigger" />
<wt:combobox field="Entity.EndianType" />
<wt:textbox field="Entity.Expressions" />
<wt:switch field="Entity.IsUpload" />
<wt:combobox field="Entity.ProtectType" />
<wt:textbox field="Entity.Alias" />
</wt:row>
<wt:quote>表达式可以进行简单的数学计算,其中raw为原值参与计算</wt:quote>
<wt:hidden field="Entity.ID" />

View File

@ -22,39 +22,61 @@
clientId: 'mqttjs_' + (Math.random() * 10000000).toString()
}
var client = mqtt.connect('ws://' + window.location.host + '/mqtt', options);
client.on('connect', function () {
client.subscribe('internal/v1/gateway/telemetry/+/+', function (err) {
if (!err) {
console.log("订阅成功!")
} else {
console.log(err)
}
})
})
client.on('connect',
function() {
client.subscribe('internal/v1/gateway/telemetry/+/+',
function(err) {
if (!err) {
console.log("订阅成功!");
} else {
console.log(err);
}
});
});
client.on('message', function (topic, message) {
var objmsg = $.parseJSON(message.toString());
client.on('message',
function(topic, message) {
var objmsg = $.parseJSON(message.toString());
//原值
$('#id' + objmsg.VarId + '_Value').text(objmsg.Value);
$('#id' + objmsg.VarId + '_Value').addClass('animated bounceIn');
setTimeout(function(){
$('#id' + objmsg.VarId + '_Value').removeClass('bounceIn');
}, 1500);
//原值
$('#id' + objmsg.VarId + '_Value').text(objmsg.Value);
$('#id' + objmsg.VarId + '_Value').addClass('animated bounceIn');
setTimeout(function() {
$('#id' + objmsg.VarId + '_Value').removeClass('bounceIn');
},
1500);
//加工值
$('#id' + objmsg.VarId + '_CookedValue').text(objmsg.CookedValue);
$('#id' + objmsg.VarId + '_CookedValue').addClass('animated bounceIn');
setTimeout(function(){
$('#id' + objmsg.VarId + '_CookedValue').removeClass('bounceIn');
}, 1500);
//加工值
$('#id' + objmsg.VarId + '_CookedValue').text(objmsg.CookedValue);
$('#id' + objmsg.VarId + '_CookedValue').addClass('animated bounceIn');
setTimeout(function() {
$('#id' + objmsg.VarId + '_CookedValue').removeClass('bounceIn');
},
1500);
//状态
$('#id' + objmsg.VarId + '_State').text(objmsg.StatusType);
$('#id' + objmsg.VarId + '_State').addClass('animated bounceIn');
setTimeout(function(){
$('#id' + objmsg.VarId + '_State').removeClass('bounceIn');
}, 1500);
})
//状态
$('#id' + objmsg.VarId + '_State').text(objmsg.StatusType);
$('#id' + objmsg.VarId + '_State').addClass('animated bounceIn');
setTimeout(function() {
$('#id' + objmsg.VarId + '_State').removeClass('bounceIn');
},
1500);
//时间
$('#id' + objmsg.VarId + '_Timestamp').text(objmsg.Timestamp);
$('#id' + objmsg.VarId + '_Timestamp').addClass('animated bounceIn');
setTimeout(function () {
$('#id' + objmsg.VarId + '_Timestamp').removeClass('bounceIn');
},
1500);
//Message
$('#id' + objmsg.VarId + '_Message').text(objmsg.Message);
$('#id' + objmsg.VarId + '_Message').addClass('animated bounceIn');
setTimeout(function () {
$('#id' + objmsg.VarId + '_Message').removeClass('bounceIn');
},
1500);
});
}
</script>

View File

@ -5,7 +5,7 @@
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="Entity.DriverName" />
<wt:textbox field="Entity.FileName" />
<wt:textbox field="Entity.AssembleName" />
<wt:display field="Entity.AssembleName" />
<wt:textbox field="Entity.AuthorizesNum" />
</wt:row>
<wt:hidden field="Entity.ID" />

View File

@ -5,5 +5,5 @@
<wt:row items-per-row="ItemsPerRowEnum.Three">
</wt:row>
</wt:searchpanel>
<wt:quote>注意目前实现了iotsharp、thingsboard、thingscloud、iotdb的遥测、属性上传以及RPC功能</wt:quote>
<wt:quote>注意目前实现了iotsharp、thingsboard、thingscloud的遥测、属性上传以及RPC功能</wt:quote>
<wt:grid vm="@Model" url="/Config/SystemConfig/Search" />

View File

@ -11,5 +11,4 @@
<wt:combobox field="Searcher.IsSuccess" empty-text="@Localizer["Sys.All"]" />
</wt:row>
</wt:searchpanel>
<wt:quote>注意不同平台的rpc的topic和payload均不同后期教程会更新到<a href="http://iotgateway.net/" target="_blank">http://iotgateway.net/</a></wt:quote>
<wt:grid vm="@Model" url="/Rpc/RpcLog/Search" hidden-checkbox="false" hidden-grid-index="true" />

View File

@ -1,16 +0,0 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR

View File

@ -1,10 +0,0 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode

View File

@ -1,16 +0,0 @@
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
quote_type = single
[*.md]
max_line_length = off
trim_trailing_whitespace = false

View File

@ -1,34 +0,0 @@
_cli-tpl/
dist/
coverage/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Dependency directories
node_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
.cache/
# yarn v2
.yarn

View File

@ -1,126 +0,0 @@
const prettierConfig = require('./.prettierrc.js');
module.exports = {
root: true,
parserOptions: { ecmaVersion: 2021 },
overrides: [
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['tsconfig.json'],
createDefaultProgram: true
},
plugins: ['@typescript-eslint', 'jsdoc', 'import'],
extends: [
'plugin:@angular-eslint/recommended',
'plugin:@angular-eslint/template/process-inline-templates',
'plugin:prettier/recommended'
],
rules: {
'prettier/prettier': ['error', prettierConfig],
'jsdoc/newline-after-description': 1,
'@angular-eslint/component-class-suffix': [
'error',
{
suffixes: ['Directive', 'Component', 'Base', 'Widget']
}
],
'@angular-eslint/directive-class-suffix': [
'error',
{
suffixes: ['Directive', 'Component', 'Base', 'Widget']
}
],
'@angular-eslint/component-selector': [
'off',
{
type: ['element', 'attribute'],
prefix: ['app', 'test'],
style: 'kebab-case'
}
],
'@angular-eslint/directive-selector': [
'off',
{
type: 'attribute',
prefix: ['app']
}
],
'@angular-eslint/no-attribute-decorator': 'error',
'@angular-eslint/no-conflicting-lifecycle': 'off',
'@angular-eslint/no-forward-ref': 'off',
'@angular-eslint/no-host-metadata-property': 'off',
'@angular-eslint/no-lifecycle-call': 'off',
'@angular-eslint/no-pipe-impure': 'error',
'@angular-eslint/prefer-output-readonly': 'error',
'@angular-eslint/use-component-selector': 'off',
'@angular-eslint/use-component-view-encapsulation': 'off',
'@angular-eslint/no-input-rename': 'off',
'@angular-eslint/no-output-native': 'off',
'@typescript-eslint/array-type': [
'error',
{
default: 'array-simple'
}
],
'@typescript-eslint/ban-types': [
'off',
{
types: {
String: {
message: 'Use string instead.'
},
Number: {
message: 'Use number instead.'
},
Boolean: {
message: 'Use boolean instead.'
},
Function: {
message: 'Use specific callable interface instead.'
}
}
}
],
'import/no-duplicates': 'error',
'import/no-unused-modules': 'error',
'import/no-unassigned-import': 'error',
'import/order': [
'error',
{
alphabetize: { order: 'asc', caseInsensitive: false },
'newlines-between': 'always',
groups: ['external', 'internal', ['parent', 'sibling', 'index']],
pathGroups: [],
pathGroupsExcludedImportTypes: []
}
],
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/member-ordering': 'off',
'no-irregular-whitespace': 'error',
'no-multiple-empty-lines': 'error',
'no-sparse-arrays': 'error',
'prefer-object-spread': 'error',
'prefer-template': 'error',
'prefer-const': 'off',
'max-len': 'off'
}
},
{
files: ['*.html'],
extends: ['plugin:@angular-eslint/template/recommended'],
rules: {}
},
{
files: ['*.html'],
excludedFiles: ['*inline-template-*.component.html'],
extends: ['plugin:prettier/recommended'],
rules: {
'prettier/prettier': ['error', { parser: 'angular' }],
'@angular-eslint/template/eqeqeq': 'off'
}
}
]
};

View File

@ -1,42 +0,0 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out
# Node
/node_modules
npm-debug.log
yarn-error.log
# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
# System files
.DS_Store
Thumbs.db

View File

@ -1,5 +0,0 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
export NODE_OPTIONS="--max-old-space-size=4096"
npx --no-install tsc -p tsconfig.app.json --noEmit
npx --no-install lint-staged

View File

@ -1 +0,0 @@
12.14.1

View File

@ -1,18 +0,0 @@
# add files you wish to ignore here
**/*.md
**/*.svg
**/test.ts
.stylelintrc
.prettierrc
src/assets/*
src/index.html
node_modules/
.vscode/
coverage/
dist/
package.json
tslint.json
_cli-tpl/**/*

View File

@ -1,13 +0,0 @@
module.exports = {
singleQuote: true,
useTabs: false,
printWidth: 140,
tabWidth: 2,
semi: true,
htmlWhitespaceSensitivity: 'strict',
arrowParens: 'avoid',
bracketSpacing: true,
proseWrap: 'preserve',
trailingComma: 'none',
endOfLine: 'lf'
};

View File

@ -1,38 +0,0 @@
{
"extends": [
"stylelint-config-standard",
"stylelint-config-rational-order",
"stylelint-config-prettier"
],
"customSyntax": "postcss-less",
"plugins": [
"stylelint-order",
"stylelint-declaration-block-no-ignored-properties"
],
"rules": {
"function-no-unknown": null,
"no-descending-specificity": null,
"plugin/declaration-block-no-ignored-properties": true,
"selector-type-no-unknown": [
true,
{
"ignoreTypes": [
"/^g2-/",
"/^nz-/",
"/^app-/"
]
}
],
"selector-pseudo-element-no-unknown": [
true,
{
"ignorePseudoElements": [
"ng-deep"
]
}
]
},
"ignoreFiles": [
"src/assets/**/*"
]
}

View File

@ -1,5 +0,0 @@
{
"recommendations": [
"cipchk.ng-alain-extension-pack"
]
}

View File

@ -1,16 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:4200",
"webRoot": "${workspaceRoot}",
"sourceMaps": true
}
]
}

View File

@ -1,37 +0,0 @@
{
"typescript.tsdk": "./node_modules/typescript/lib",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
// For ESLint
"source.fixAll.eslint": true,
// For Stylelint
"source.fixAll.stylelint": true
},
"[markdown]": {
"editor.formatOnSave": false
},
"[javascript]": {
"editor.formatOnSave": false
},
"[json]": {
"editor.formatOnSave": false
},
"[jsonc]": {
"editor.formatOnSave": false
},
"files.watcherExclude": {
"**/.git/*/**": true,
"**/node_modules/*/**": true,
"**/dist/*/**": true,
"**/coverage/*/**": true
},
"files.associations": {
"*.json": "jsonc",
".prettierrc": "jsonc",
".stylelintrc": "jsonc"
},
// Angular schematics : https://marketplace.visualstudio.com/items?itemName=cyrilletuzi.angular-schematics
"ngschematics.schematics": [
"ng-alain"
]
}

View File

@ -1,42 +0,0 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
},
{
"type": "npm",
"script": "test",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
}
]
}

View File

@ -1,27 +0,0 @@
# STEP 1: Build
FROM node:10 as builder
LABEL authors="iotgateway"
COPY package.json package-lock.json ./
RUN npm set progress=false && npm config set depth 0 && npm cache clean --force
RUN npm i && mkdir /iotgateway && cp -R ./node_modules ./iotgateway
WORKDIR /iotgateway
COPY . .
RUN npm run build
# STEP 2: Setup
FROM nginx:alpine
COPY --from=builder /iotgateway/_nginx/default.conf /etc/nginx/conf.d/default.conf
# COPY --from=builder /iotgateway/_nginx/ssl/* /etc/nginx/ssl/
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /iotgateway/dist /usr/share/nginx/html
CMD [ "nginx", "-g", "daemon off;"]

View File

@ -1 +0,0 @@
[Document](https://ng-alain.com/mock)

View File

@ -1,122 +0,0 @@
import { MockRequest } from '@delon/mock';
const list: any[] = [];
const total = 50;
for (let i = 0; i < total; i += 1) {
list.push({
id: i + 1,
disabled: i % 6 === 0,
href: 'https://ant.design',
avatar: [
'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png'
][i % 2],
no: `TradeCode ${i}`,
title: `一个任务名称 ${i}`,
owner: '曲丽丽',
description: '这是一段描述',
callNo: Math.floor(Math.random() * 1000),
status: Math.floor(Math.random() * 10) % 4,
updatedAt: new Date(`2017-07-${Math.floor(i / 2) + 1}`),
createdAt: new Date(`2017-07-${Math.floor(i / 2) + 1}`),
progress: Math.ceil(Math.random() * 100)
});
}
function genData(params: any): { total: number; list: any[] } {
let ret = [...list];
const pi = +params.pi;
const ps = +params.ps;
const start = (pi - 1) * ps;
if (params.no) {
ret = ret.filter(data => data.no.indexOf(params.no) > -1);
}
return { total: ret.length, list: ret.slice(start, ps * pi) };
}
function saveData(id: number, value: any): { msg: string } {
const item = list.find(w => w.id === id);
if (!item) {
return { msg: '无效用户信息' };
}
Object.assign(item, value);
return { msg: 'ok' };
}
export const USERS = {
'/user': (req: MockRequest) => genData(req.queryString),
'/user/:id': (req: MockRequest) => list.find(w => w.id === +req.params.id),
'POST /user/:id': (req: MockRequest) => saveData(+req.params.id, req.body),
'/user/current': {
name: 'IoTGateway',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
userid: '00000001',
email: '535915157@qq.com',
signature: '海纳百川,有容乃大',
title: '交互专家',
group: '蚂蚁金服某某某事业群某某平台部某某技术部UED',
tags: [
{
key: '0',
label: '很有想法的'
},
{
key: '1',
label: '专注撩妹'
},
{
key: '2',
label: '帅~'
},
{
key: '3',
label: '通吃'
},
{
key: '4',
label: '专职后端'
},
{
key: '5',
label: '海纳百川'
}
],
notifyCount: 12,
country: 'China',
geographic: {
province: {
label: '上海',
key: '330000'
},
city: {
label: '市辖区',
key: '330100'
}
},
address: 'XX区XXX路 XX 号',
phone: '你猜-你猜你猜猜猜'
},
'POST /user/avatar': 'ok',
'POST /login/account': (req: MockRequest) => {
const data = req.body;
if (!(data.userName === 'admin') || data.password !== '000000') {
return { msg: `Invalid username or passwordadmin/000000` };
}
return {
msg: 'ok',
user: {
token: '123456789',
name: data.userName,
email: `535915157@qq.com`,
id: 10000,
time: +new Date()
}
};
},
'POST /register': {
msg: 'ok'
}
};

View File

@ -1 +0,0 @@
export * from './_user';

View File

@ -1,27 +0,0 @@
server {
listen 80;
# listen 443;
# ssl on;
# ssl_certificate /etc/nginx/ssl/server.crt;
# ssl_certificate_key /etc/nginx/ssl/server.key;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

Some files were not shown because too many files have changed in this diff Show More