merge branch 'private'. this is version 2.0
This commit is contained in:
parent
6cdac03ef4
commit
359561cac4
282
3d/3d.html
Normal file
282
3d/3d.html
Normal 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
108
3d/css/main.css
Normal 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
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
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
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
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
308
3d/lib/CSS3DRenderer.js
Normal 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
587
3d/lib/DRACOLoader.js
Normal 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
4349
3d/lib/GLTFLoader.js
Normal file
File diff suppressed because it is too large
Load Diff
1252
3d/lib/OrbitControls.js
Normal file
1252
3d/lib/OrbitControls.js
Normal file
File diff suppressed because it is too large
Load Diff
121
3d/lib/RoomEnvironment.js
Normal file
121
3d/lib/RoomEnvironment.js
Normal 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
63
3d/lib/ShaderPass.js
Normal 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
14
3d/lib/dat.gui.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
48
3d/lib/gltf/draco_decoder.js
Normal file
48
3d/lib/gltf/draco_decoder.js
Normal file
File diff suppressed because one or more lines are too long
BIN
3d/lib/gltf/draco_decoder.wasm
Normal file
BIN
3d/lib/gltf/draco_decoder.wasm
Normal file
Binary file not shown.
33
3d/lib/gltf/draco_encoder.js
Normal file
33
3d/lib/gltf/draco_encoder.js
Normal file
File diff suppressed because one or more lines are too long
104
3d/lib/gltf/draco_wasm_wrapper.js
Normal file
104
3d/lib/gltf/draco_wasm_wrapper.js
Normal 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
167
3d/lib/stats.module.js
Normal 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
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
BIN
3d/model/LittlestTokyo.glb
Normal file
Binary file not shown.
Binary file not shown.
BIN
Export_DeviceSettings_202304122238403461.xlsx
Normal file
BIN
Export_DeviceSettings_202304122238403461.xlsx
Normal file
Binary file not shown.
871
IoTGateway.DataAccess/Migrations/20230412061736_IsUpload.Designer.cs
generated
Normal file
871
IoTGateway.DataAccess/Migrations/20230412061736_IsUpload.Designer.cs
generated
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
36
IoTGateway.DataAccess/Migrations/20230412061736_IsUpload.cs
Normal file
36
IoTGateway.DataAccess/Migrations/20230412061736_IsUpload.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
@ -125,6 +125,9 @@ namespace IoTGateway.DataAccess.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Alias")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("DataType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
@ -146,6 +149,9 @@ namespace IoTGateway.DataAccess.Migrations
|
||||
b.Property<uint>("Index")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsUpload")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Method")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
using PluginInterface;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace IoTGateway.Model
|
||||
@ -28,6 +31,9 @@ namespace IoTGateway.Model
|
||||
[Display(Name = "表达式")]
|
||||
public string Expressions { get; set; }
|
||||
|
||||
[Display(Name = "上传")]
|
||||
public bool IsUpload { get; set; }
|
||||
|
||||
[Display(Name = "权限")]
|
||||
public ProtectTypeEnum ProtectType { get; set; }
|
||||
|
||||
@ -38,5 +44,24 @@ namespace IoTGateway.Model
|
||||
public Device Device { get; set; }
|
||||
[Display(Name = "设备")]
|
||||
public Guid? DeviceId { get; set; }
|
||||
|
||||
[Display(Name = "别名")]
|
||||
public string Alias { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
[Display(Name = "原值")]
|
||||
public object Value { get; set; }
|
||||
[NotMapped]
|
||||
[Display(Name = "值")]
|
||||
public object CookedValue { get; set; }
|
||||
[NotMapped]
|
||||
public string Message { get; set; }
|
||||
[NotMapped]
|
||||
[Display(Name = "更新时间")]
|
||||
public DateTime Timestamp { get; set; }
|
||||
[NotMapped]
|
||||
[Display(Name = "状态")]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public VaribaleStatusTypeEnum StatusType { get; set; } = VaribaleStatusTypeEnum.UnKnow;
|
||||
}
|
||||
}
|
@ -37,6 +37,6 @@ namespace IoTGateway.Model
|
||||
[Display(Name = "ThingsCloud")]
|
||||
ThingsCloud = 6,
|
||||
[Display(Name = "华为云")]
|
||||
HuaWei = 7,
|
||||
HuaWei = 7
|
||||
}
|
||||
}
|
@ -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),
|
||||
|
@ -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
|
||||
{
|
||||
@ -78,7 +78,9 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
|
||||
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);
|
||||
|
||||
|
@ -38,10 +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 rpcLogs = DC.Set<RpcLog>().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(rpcLogs);
|
||||
DC.Set<RpcLog>().RemoveRange(rpcs);
|
||||
}
|
||||
pluginManager.RemoveDeviceThread(dap);
|
||||
}
|
||||
|
@ -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","导入Excel","导入Excel", GridActionParameterTypesEnum.NoId,"BasicData",600).SetIconCls("layui-icon layui-icon-upload-circle").SetDialogTitle("导入Excel模板").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)
|
||||
|
@ -22,7 +22,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
AllDrivers = DC.Set<Driver>().GetSelectListItems(Wtm, y => y.DriverName);
|
||||
AllDrivers = DC.Set<Driver>().GetSelectListItems(Wtm, y => y.FileName);
|
||||
AllParents = DC.Set<Device>().Where(x=>x.DeviceTypeEnum== DeviceTypeEnum.Group).GetSelectListItems(Wtm, y => y.DeviceName);
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,8 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
|
||||
public string Expression { get; set; }
|
||||
[Display(Name = "权限")]
|
||||
public ProtectTypeEnum? ProtectType { get; set; }
|
||||
[Display(Name = "设备别名")]
|
||||
public String Alias { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
|
@ -29,9 +29,13 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
|
||||
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()
|
||||
{
|
||||
|
@ -63,22 +63,27 @@ 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.EndianType).SetSort(true).SetWidth(120),
|
||||
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.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.IsUpload).SetWidth(80),
|
||||
//this.MakeGridHeader(x => x.ProtectType).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=> "detail").SetHide().SetFormat((a,b)=>{
|
||||
return "false";
|
||||
}),
|
||||
@ -96,12 +101,15 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
|
||||
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))
|
||||
var dapThread = deviceService!.DeviceThreads.FirstOrDefault(x => x.Device.ID == item.DeviceId);
|
||||
var variable = dapThread?.Device?.DeviceVariables?.FirstOrDefault(x => x.ID == item.ID);
|
||||
|
||||
if (variable != null)
|
||||
{
|
||||
item.Value = DapThread?.DeviceValues[item.ID]?.Value?.ToString();
|
||||
item.CookedValue = DapThread?.DeviceValues[item.ID]?.CookedValue?.ToString();
|
||||
item.State = DapThread?.DeviceValues[item.ID]?.StatusType.ToString();
|
||||
item.Value = variable.Value;
|
||||
item.CookedValue = variable.CookedValue;
|
||||
item.StatusType = variable.StatusType;
|
||||
item.Timestamp = variable.Timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,6 +121,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
|
||||
|
||||
var query = DC.Set<DeviceVariable>().Include(x => x.Device)
|
||||
.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)
|
||||
@ -129,11 +138,13 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
|
||||
DataType = x.DataType,
|
||||
EndianType = x.EndianType,
|
||||
Expressions = x.Expressions,
|
||||
IsUpload=x.IsUpload,
|
||||
ProtectType = x.ProtectType,
|
||||
DeviceName_view = x.Device.DeviceName,
|
||||
Alias = x.Alias,
|
||||
Device = x.Device
|
||||
})
|
||||
.OrderBy(x => x.DeviceName_view).ThenBy(x => x.Index);
|
||||
.OrderBy(x => x.Index).ThenBy(x => x.DeviceName_view).ThenBy(x => x.Alias).ThenBy(x => x.Method).ThenBy(x => x.DeviceAddress);
|
||||
return query;
|
||||
}
|
||||
|
||||
@ -196,13 +207,6 @@ 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; }
|
||||
|
||||
public string DeviceName_view { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -3,6 +3,7 @@ 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;
|
||||
@ -24,6 +25,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
this.Entity.IsUpload = true;
|
||||
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 +76,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;
|
||||
}
|
||||
}
|
||||
|
@ -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()];
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
304
IoTGateway.ViewModel/BasicData/ExportDevicesSetting.cs
Normal file
304
IoTGateway.ViewModel/BasicData/ExportDevicesSetting.cs
Normal file
@ -0,0 +1,304 @@
|
||||
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);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
284
IoTGateway.ViewModel/BasicData/ImportExcelVM.cs
Normal file
284
IoTGateway.ViewModel/BasicData/ImportExcelVM.cs
Normal file
@ -0,0 +1,284 @@
|
||||
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 myMqttClient = Wtm.ServiceProvider.GetService(typeof(MyMqttClient)) as MyMqttClient;
|
||||
myMqttClient.StartClientAsync().Wait();
|
||||
|
||||
//重新启动采集
|
||||
foreach (var device in devices.Where(x => x.DeviceTypeEnum == DeviceTypeEnum.Device && x.DriverId != null))
|
||||
{
|
||||
device.Driver = _drivers.FirstOrDefault(x => x.ID == device.DriverId);
|
||||
deviceService.CreateDeviceThread(device);
|
||||
}
|
||||
导入结果 =
|
||||
$"成功导入{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());
|
||||
|
||||
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));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
252
IoTGateway.sln
252
IoTGateway.sln
@ -27,27 +27,43 @@ 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
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -129,94 +145,102 @@ 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
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@ -228,17 +252,25 @@ 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}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {1F219808-E6E8-4C1D-B846-41F2F7CF20FA}
|
||||
|
@ -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,18 @@ 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 = "DeviceSettings";
|
||||
exportName = $"Export_{exportName}_{DateTime.Now.ToString("yyyyMMddHHmmssffff")}.xlsx";
|
||||
FileContentResult Result = new FileContentResult(data, ContentType);
|
||||
Result.FileDownloadName = exportName;
|
||||
return Result;
|
||||
|
||||
//return vm.GetExportData();
|
||||
}
|
||||
|
||||
#region 设备复制
|
||||
@ -307,5 +319,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
|
||||
}
|
||||
}
|
||||
|
18
IoTGateway/Areas/BasicData/Views/Device/ImportExcel.cshtml
Normal file
18
IoTGateway/Areas/BasicData/Views/Device/ImportExcel.cshtml
Normal 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>
|
@ -10,6 +10,7 @@
|
||||
<wt:combobox field="LinkedVM.EndianType" />
|
||||
<wt:textbox field="LinkedVM.Expression" />
|
||||
<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" />
|
||||
|
@ -12,7 +12,9 @@
|
||||
<wt:combobox field="Entity.DataType" />
|
||||
<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">
|
||||
|
@ -12,6 +12,7 @@
|
||||
<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 />
|
||||
|
@ -12,7 +12,9 @@
|
||||
<wt:combobox field="Entity.DataType" />
|
||||
<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" />
|
||||
|
@ -10,6 +10,7 @@
|
||||
<wt:combobox field="Searcher.DataType" empty-text="@Localizer["Sys.All"]" />
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:quote>Modbus驱动已支持大小端</wt:quote>
|
||||
<wt:grid vm="@Model" url="/BasicData/DeviceVariable/Search" hidden-grid-index="true" done-func="inimqttclient" />
|
||||
</wt:treecontainer>
|
||||
<link href="~/sitecss/animate.min.css" rel="stylesheet" />
|
||||
@ -22,17 +23,20 @@
|
||||
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) {
|
||||
client.on('connect',
|
||||
function() {
|
||||
client.subscribe('internal/v1/gateway/telemetry/+/+',
|
||||
function(err) {
|
||||
if (!err) {
|
||||
console.log("订阅成功!")
|
||||
console.log("订阅成功!");
|
||||
} else {
|
||||
console.log(err)
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
client.on('message', function (topic, message) {
|
||||
client.on('message',
|
||||
function(topic, message) {
|
||||
var objmsg = $.parseJSON(message.toString());
|
||||
|
||||
//原值
|
||||
@ -40,21 +44,32 @@
|
||||
$('#id' + objmsg.VarId + '_Value').addClass('animated bounceIn');
|
||||
setTimeout(function() {
|
||||
$('#id' + objmsg.VarId + '_Value').removeClass('bounceIn');
|
||||
}, 1500);
|
||||
},
|
||||
1500);
|
||||
|
||||
//加工值
|
||||
$('#id' + objmsg.VarId + '_CookedValue').text(objmsg.CookedValue);
|
||||
$('#id' + objmsg.VarId + '_CookedValue').addClass('animated bounceIn');
|
||||
setTimeout(function() {
|
||||
$('#id' + objmsg.VarId + '_CookedValue').removeClass('bounceIn');
|
||||
}, 1500);
|
||||
},
|
||||
1500);
|
||||
|
||||
//状态
|
||||
$('#id' + objmsg.VarId + '_State').text(objmsg.StatusType);
|
||||
$('#id' + objmsg.VarId + '_State').addClass('animated bounceIn');
|
||||
setTimeout(function() {
|
||||
$('#id' + objmsg.VarId + '_State').removeClass('bounceIn');
|
||||
}, 1500);
|
||||
})
|
||||
},
|
||||
1500);
|
||||
|
||||
//时间
|
||||
$('#id' + objmsg.VarId + '_Timestamp').text(objmsg.Timestamp);
|
||||
$('#id' + objmsg.VarId + '_Timestamp').addClass('animated bounceIn');
|
||||
setTimeout(function () {
|
||||
$('#id' + objmsg.VarId + '_Timestamp').removeClass('bounceIn');
|
||||
},
|
||||
1500);
|
||||
});
|
||||
}
|
||||
</script>
|
@ -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" />
|
||||
|
@ -83,14 +83,14 @@ namespace IoTGateway.Controllers
|
||||
data.Add(new ChartData
|
||||
{
|
||||
Category = deviceThread.Device.DeviceName,
|
||||
Value = deviceThread.DeviceValues.Where(x => x.Value.StatusType != VaribaleStatusTypeEnum.Good).Count(),
|
||||
Value = deviceThread.Device.DeviceVariables.Count(x => x.StatusType != VaribaleStatusTypeEnum.Good),
|
||||
Series = "Others"
|
||||
});
|
||||
|
||||
data.Add(new ChartData
|
||||
{
|
||||
Category = deviceThread.Device.DeviceName,
|
||||
Value = deviceThread.DeviceValues.Where(x => x.Value.StatusType == VaribaleStatusTypeEnum.Good).Count(),
|
||||
Value = deviceThread.Device.DeviceVariables.Count(x => x.StatusType == VaribaleStatusTypeEnum.Good),
|
||||
Series = "Good"
|
||||
});
|
||||
|
||||
|
@ -7,28 +7,16 @@
|
||||
<SatelliteResourceLanguages>zh-Hans,en</SatelliteResourceLanguages>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="ClientApp\**" />
|
||||
<Content Remove="ClientApp\**" />
|
||||
<EmbeddedResource Remove="ClientApp\**" />
|
||||
<None Remove="ClientApp\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="iotgateway.db-shm" />
|
||||
<None Remove="iotgateway.db-wal" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
|
||||
<PackageReference Include="MQTTnet" Version="4.1.2.350" />
|
||||
<PackageReference Include="MQTTnet.AspNetCore" Version="4.1.2.350" />
|
||||
<PackageReference Include="MQTTnet.Extensions.Rpc" Version="4.1.2.350" />
|
||||
<PackageReference Include="NLog" Version="5.0.5" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.1.5" />
|
||||
<PackageReference Include="MQTTnet" Version="4.1.4.563" />
|
||||
<PackageReference Include="MQTTnet.AspNetCore" Version="4.1.4.563" />
|
||||
<PackageReference Include="MQTTnet.Extensions.Rpc" Version="4.1.4.563" />
|
||||
<PackageReference Include="NLog" Version="5.1.3" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.2.3" />
|
||||
<PackageReference Include="System.IO.Ports" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -40,11 +28,6 @@
|
||||
<ProjectReference Include="..\WalkingTec.Mvvm\WalkingTec.Mvvm.TagHelpers.LayUI\WalkingTec.Mvvm.TagHelpers.LayUI.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties appsettings_1json__JsonSchema="" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
|
||||
|
||||
|
@ -15,8 +15,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ProjectGuid>68abbdf2-1485-4756-9a94-6afa874d69a3</ProjectGuid>
|
||||
<SelfContained>false</SelfContained>
|
||||
<SelfContained>true</SelfContained>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<PublishSingleFile>false</PublishSingleFile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_PublishTargetUrl>D:\000000-IIoTGateway\00000-iotgateway\IoTGateway\bin\Release\net6.0\publish\</_PublishTargetUrl>
|
||||
<History>True|2022-08-30T12:02:03.8144013Z;True|2022-08-30T19:59:49.6042620+08:00;True|2022-08-30T19:52:02.8823029+08:00;True|2022-08-30T19:36:54.3646619+08:00;True|2022-07-15T22:49:16.0563176+08:00;True|2022-07-15T22:48:07.3189129+08:00;True|2022-07-15T22:44:35.7670375+08:00;True|2022-07-15T22:40:17.0184184+08:00;True|2022-06-09T15:43:47.6180879+08:00;True|2022-06-09T15:42:06.6021355+08:00;False|2022-06-09T15:41:10.3444145+08:00;False|2022-06-09T15:39:22.0048230+08:00;False|2022-06-09T15:37:35.5049088+08:00;True|2022-06-09T15:34:27.8095097+08:00;True|2022-06-09T15:33:30.9577399+08:00;False|2022-06-09T15:29:58.9432537+08:00;False|2022-06-09T15:29:15.9735490+08:00;True|2022-06-09T15:27:02.3333134+08:00;True|2022-06-09T15:18:02.0623963+08:00;True|2022-01-24T23:31:28.3620602+08:00;True|2022-01-24T23:30:03.8991942+08:00;True|2022-01-24T23:23:16.4288882+08:00;True|2021-12-24T19:18:19.0736393+08:00;True|2021-12-24T16:46:49.1192015+08:00;True|2021-12-24T16:23:28.9214784+08:00;True|2021-12-24T15:20:08.6401847+08:00;True|2021-12-17T19:11:07.1655146+08:00;True|2021-12-12T14:11:08.8380502+08:00;</History>
|
||||
<History>True|2023-02-27T03:39:28.6812515Z;True|2023-02-20T16:42:44.7526644+08:00;True|2023-02-20T16:12:12.9091659+08:00;True|2023-02-20T09:51:20.5504880+08:00;True|2023-02-20T09:35:31.1757073+08:00;True|2023-01-13T15:48:56.7869969+08:00;True|2022-11-21T15:59:03.8927175+08:00;True|2022-11-21T15:58:06.9464735+08:00;True|2022-11-21T15:57:24.8426888+08:00;True|2022-11-21T15:55:06.1675530+08:00;True|2022-10-20T22:40:01.3534004+08:00;True|2022-08-30T20:02:03.8144013+08:00;True|2022-08-30T19:59:49.6042620+08:00;True|2022-08-30T19:52:02.8823029+08:00;True|2022-08-30T19:36:54.3646619+08:00;True|2022-07-15T22:49:16.0563176+08:00;True|2022-07-15T22:48:07.3189129+08:00;True|2022-07-15T22:44:35.7670375+08:00;True|2022-07-15T22:40:17.0184184+08:00;True|2022-06-09T15:43:47.6180879+08:00;True|2022-06-09T15:42:06.6021355+08:00;False|2022-06-09T15:41:10.3444145+08:00;False|2022-06-09T15:39:22.0048230+08:00;False|2022-06-09T15:37:35.5049088+08:00;True|2022-06-09T15:34:27.8095097+08:00;True|2022-06-09T15:33:30.9577399+08:00;False|2022-06-09T15:29:58.9432537+08:00;False|2022-06-09T15:29:15.9735490+08:00;True|2022-06-09T15:27:02.3333134+08:00;True|2022-06-09T15:18:02.0623963+08:00;True|2022-01-24T23:31:28.3620602+08:00;True|2022-01-24T23:30:03.8991942+08:00;True|2022-01-24T23:23:16.4288882+08:00;True|2021-12-24T19:18:19.0736393+08:00;True|2021-12-24T16:46:49.1192015+08:00;True|2021-12-24T16:23:28.9214784+08:00;True|2021-12-24T15:20:08.6401847+08:00;True|2021-12-17T19:11:07.1655146+08:00;True|2021-12-12T14:11:08.8380502+08:00;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -56,14 +56,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md2">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">技术支持</div>
|
||||
<div class="layui-card-body">
|
||||
<img src="/images/wx.png" alt="" height="170">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">设备状态</div>
|
||||
@ -72,7 +64,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md5">
|
||||
<div class="layui-col-md9">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">设备变量状态</div>
|
||||
<div class="layui-card-body">
|
||||
@ -80,15 +72,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-col-md2">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">公众号</div>
|
||||
<div class="layui-card-body">
|
||||
<img src="/images/公众号.jpg" alt="" height="170">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">访问分布TODO</div>
|
||||
|
@ -37,8 +37,8 @@
|
||||
<div class="loginBody app-login-back-@bgnumber" style="flex: 1 1 auto !important; ">
|
||||
<header class="login-header">
|
||||
<img src="/images/logo.png" alt="" height="48">
|
||||
<img src="/images/wx.png" alt="" height="150">
|
||||
<img src="/images/公众号.jpg" alt="" style="float:right" height="150">
|
||||
<img src="/images/wxgroup.png" alt="" style="float:right" height="150">
|
||||
<img src="/images/公众号.jpg" alt="" height="150">
|
||||
</header>
|
||||
<div class="login-content">
|
||||
<div class="login-form">
|
||||
@ -70,9 +70,10 @@
|
||||
<li>
|
||||
<span class="login-error">@Model.MSD.GetFirstError()</span>
|
||||
<button type="submit" class="login-button" style="cursor:pointer">@Model.Localizer["Login.Login"]</button>
|
||||
<div class="login-button" style="cursor:pointer">
|
||||
<a href="http://iotgateway.net/" target="_blank">跳转教程文档,持续更新,收藏不迷路</a>
|
||||
</div>
|
||||
|
||||
<button class="login-button" style="cursor: pointer">
|
||||
<a href="http://iotgateway.net/docs/enterprise/intro" target="_blank">教程文档</a>
|
||||
</button>
|
||||
|
||||
@*<wt:linkbutton window-title="@Model.Localizer["Login.Register"]" class="login-button" style="cursor:pointer" target="ButtonTargetEnum.Layer" window-width="500" window-height="500" url="/Login/Reg" text="@Model.Localizer["Login.Register"]" />*@
|
||||
</li>
|
||||
|
Binary file not shown.
@ -32,6 +32,6 @@
|
||||
<logger name="Microsoft.*" minlevel="Error" final="true" />
|
||||
<logger name="System.Net.Http.*" minlevel="Error" final="true" />
|
||||
|
||||
<logger name="*" minlevel="Info" writeTo="ownFile-web" />
|
||||
<logger name="*" minlevel="Error" writeTo="ownFile-web" />
|
||||
</rules>
|
||||
</nlog>
|
BIN
IoTGateway/wwwroot/images/wxgroup.png
Normal file
BIN
IoTGateway/wwwroot/images/wxgroup.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
@ -9,7 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="HslCommunication" Version="11.2.1" />
|
||||
<PackageReference Include="HslCommunication" Version="11.5.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
@ -1,13 +1,13 @@
|
||||
using PluginInterface;
|
||||
using HslCommunication.CNC.Fanuc;
|
||||
using HslCommunication;
|
||||
using HslCommunication.CNC.Fanuc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace DriverFanucHsl
|
||||
namespace CNC.Fanuc.H
|
||||
{
|
||||
[DriverSupported("Fanuc-0i")]
|
||||
[DriverInfo("Fanuc-0i", "V11.0.0", "Copyright HSL ")]
|
||||
public class FanucHsl : IDriver
|
||||
[DriverSupported("Series0i")]
|
||||
[DriverInfo("Fanuc", "V1.0.0", "Copyright iotgateway.net 20230220")]
|
||||
public class DeviceFanuc : IDriver
|
||||
{
|
||||
private FanucSeries0i _fanuc;
|
||||
|
||||
@ -28,13 +28,13 @@ namespace DriverFanucHsl
|
||||
|
||||
#endregion
|
||||
|
||||
public FanucHsl(string device, ILogger logger)
|
||||
#region 生命周期
|
||||
|
||||
public DeviceFanuc(string device, ILogger logger)
|
||||
{
|
||||
// 授权示例 Authorization example
|
||||
if (!Authorization.SetAuthorizationCode("输入你的授权号"))
|
||||
{
|
||||
//return; // 激活失败应该退出系统
|
||||
}
|
||||
//输入授权码,禁止非法使用
|
||||
if (!Authorization.SetAuthorizationCode(""))
|
||||
return;
|
||||
|
||||
_device = device;
|
||||
_logger = logger;
|
||||
@ -64,12 +64,15 @@ namespace DriverFanucHsl
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation($"Device:[{_device}],Connect()");
|
||||
|
||||
_fanuc.ConnectClose();
|
||||
_fanuc = new FanucSeries0i(IpAddress, Port);
|
||||
return _fanuc.ConnectServer().IsSuccess;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"Device:[{_device}],Connect()");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -78,21 +81,40 @@ namespace DriverFanucHsl
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation($"Device:[{_device}],Close()");
|
||||
_fanuc.ConnectClose();
|
||||
return !IsConnected;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"Device:[{_device}],Close()");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger?.LogInformation($"Device:[{_device}],Dispose()");
|
||||
_fanuc?.Dispose();
|
||||
|
||||
// Suppress finalization.
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"Device:[{_device}],Dispose()");
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 读写方法
|
||||
|
||||
|
||||
[Method("Fanuc", description: "读系统状态")]
|
||||
public DriverReturnValueModel ReadSysStatusInfo(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadSysStatusInfo(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -124,7 +146,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "读报警信息")]
|
||||
public DriverReturnValueModel ReadSystemAlarm(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadSystemAlarm(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -156,7 +178,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "坐标数据")]
|
||||
public DriverReturnValueModel ReadSysAllCoors(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadSysAllCoors(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -188,7 +210,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "程序列表")]
|
||||
public DriverReturnValueModel ReadProgramList(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadProgramList(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -220,7 +242,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "当前程序名")]
|
||||
public DriverReturnValueModel ReadSystemProgramCurrent(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadSystemProgramCurrent(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -255,7 +277,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "主轴转进速")]
|
||||
public DriverReturnValueModel ReadSpindleSpeedAndFeedRate(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadSpindleSpeedAndFeedRate(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -290,7 +312,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "伺服负载")]
|
||||
public DriverReturnValueModel ReadFanucAxisLoad(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadFanucAxisLoad(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -322,7 +344,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "道具补偿")]
|
||||
public DriverReturnValueModel ReadCutterInfos(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadCutterInfos(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -354,7 +376,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "程序路径")]
|
||||
public DriverReturnValueModel ReadCurrentForegroundDir(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadCurrentForegroundDir(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -386,7 +408,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "工件尺寸")]
|
||||
public DriverReturnValueModel ReadDeviceWorkPiecesSize(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadDeviceWorkPiecesSize(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -418,7 +440,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "报警代号")]
|
||||
public DriverReturnValueModel ReadAlarmStatus(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadAlarmStatus(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -450,7 +472,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "机床时间")]
|
||||
public DriverReturnValueModel ReadCurrentDateTime(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadCurrentDateTime(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -482,7 +504,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "已加工数量")]
|
||||
public DriverReturnValueModel ReadCurrentProduceCount(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadCurrentProduceCount(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -514,7 +536,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "总加工数量")]
|
||||
public DriverReturnValueModel ReadExpectProduceCount(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadExpectProduceCount(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -546,7 +568,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "系统语言")]
|
||||
public DriverReturnValueModel ReadLanguage(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadLanguage(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -578,7 +600,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "当前程序")]
|
||||
public DriverReturnValueModel ReadCurrentProgram(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadCurrentProgram(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -610,7 +632,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "开机时间")]
|
||||
public DriverReturnValueModel ReadOnLineTime(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadOnLineTime(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -642,7 +664,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "运行时间")]
|
||||
public DriverReturnValueModel ReadRunTime(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadRunTime(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -674,7 +696,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "切割时间")]
|
||||
public DriverReturnValueModel ReadCuttingTime(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadCuttingTime(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -706,7 +728,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "空闲时间")]
|
||||
public DriverReturnValueModel ReadIdleTime(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadIdleTime(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -738,7 +760,7 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "当前道具号")]
|
||||
public DriverReturnValueModel ReadCutterNumber(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadCutterNumber(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
@ -770,14 +792,14 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "读宏变量")]
|
||||
public DriverReturnValueModel ReadSystemMacroValue(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadSystemMacroValue(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!int.TryParse(ioarg.Address, out int address))
|
||||
if (!int.TryParse(ioArg.Address, out int address))
|
||||
{
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = $"宏变量地址错误";
|
||||
@ -810,14 +832,14 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
[Method("Fanuc", description: "读取程序")]
|
||||
public DriverReturnValueModel ReadProgramAsync(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadProgramAsync(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
if (IsConnected)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!int.TryParse(ioarg.Address, out int address))
|
||||
if (!int.TryParse(ioArg.Address, out int address))
|
||||
{
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = $"程序号错误";
|
||||
@ -850,15 +872,18 @@ namespace DriverFanucHsl
|
||||
}
|
||||
|
||||
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioarg)
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
RpcResponse rpcResponse = new() { IsSuccess = false, Description = "设备驱动内未实现写入功能" };
|
||||
return rpcResponse;
|
||||
}
|
||||
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioarg)
|
||||
#endregion
|
||||
|
||||
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return new DriverReturnValueModel(VaribaleStatusTypeEnum.MethodError);
|
||||
}
|
||||
|
||||
private enum LanguageType
|
@ -1,11 +1,11 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PluginInterface;
|
||||
using PluginInterface;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace DriverFaunc
|
||||
namespace CNC.Fanuc
|
||||
{
|
||||
[DriverSupported("Fanuc-0i")]
|
||||
[DriverInfo("Fanuc-0i", "V1.0.0", "Copyright IoTGateway© 2022-05-25")]
|
||||
public class Fanuc : IDriver
|
||||
[DriverSupported("Fanuc")]
|
||||
[DriverInfo("Fanuc", "V1.0.0", "Copyright iotgateway.net 20230220")]
|
||||
public class DeviceFanuc : IDriver
|
||||
{
|
||||
private ushort _hndl;
|
||||
private int _result = -1;
|
||||
@ -23,7 +23,8 @@ namespace DriverFaunc
|
||||
|
||||
#endregion
|
||||
|
||||
public Fanuc(string device, ILogger logger)
|
||||
#region 生命周期
|
||||
public DeviceFanuc(string device, ILogger logger)
|
||||
{
|
||||
_device = device;
|
||||
_logger = logger;
|
||||
@ -50,21 +51,6 @@ namespace DriverFaunc
|
||||
}
|
||||
}
|
||||
|
||||
public bool Close()
|
||||
{
|
||||
try
|
||||
{
|
||||
_result = FanucFocas.cnc_freelibhndl(_hndl);
|
||||
if (_result == FanucFocas.EW_OK)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Connect()
|
||||
{
|
||||
try
|
||||
@ -83,11 +69,31 @@ namespace DriverFaunc
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
public bool Close()
|
||||
{
|
||||
try
|
||||
{
|
||||
_result = FanucFocas.cnc_freelibhndl(_hndl);
|
||||
if (_result == FanucFocas.EW_OK)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//设备类型
|
||||
public void Dispose()
|
||||
{
|
||||
// Suppress finalization.
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 读写方法
|
||||
|
||||
|
||||
[Method("Fanuc", description: "读Fanuc设备类型")]
|
||||
public DriverReturnValueModel ReadDeviceType(DriverAddressIoArgModel ioarg)
|
||||
{
|
||||
@ -977,20 +983,32 @@ namespace DriverFaunc
|
||||
return ret;
|
||||
}
|
||||
|
||||
#region 无用方法
|
||||
|
||||
/// <summary>
|
||||
/// 无用方法
|
||||
/// </summary>
|
||||
/// <param name="ioarg"></param>
|
||||
/// <returns></returns>
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioarg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioarg)
|
||||
/// <summary>
|
||||
/// 写
|
||||
/// </summary>
|
||||
/// <param name="requestId"></param>
|
||||
/// <param name="method"></param>
|
||||
/// <param name="ioarg"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioarg)
|
||||
{
|
||||
RpcResponse rpcResponse = new() { IsSuccess = false, Description = "设备驱动内未实现写入功能" };
|
||||
return Task.FromResult(rpcResponse);
|
||||
await Task.CompletedTask;
|
||||
return rpcResponse;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DriverFaunc
|
||||
namespace CNC.Fanuc
|
||||
{
|
||||
|
||||
public class FanucFocas : Focas1
|
@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DriverFaunc
|
||||
namespace CNC.Fanuc
|
||||
{
|
||||
|
||||
public class Focas1
|
@ -1,12 +1,12 @@
|
||||
using PluginInterface;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using OpenNETCF.MTConnect;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace DriverMTConnect
|
||||
namespace CNC.MTConnect
|
||||
{
|
||||
[DriverSupported("MTConnect")]
|
||||
[DriverInfo("MTConnect", "V1.0.0", "Copyright IoTGateway© 2022-08-10")]
|
||||
public class MTConnectClient : IDriver
|
||||
[DriverSupported("MTConnectClient")]
|
||||
[DriverInfo("MTConnectClient", "V1.0.0", "Copyright IoTGateway.net 20230220")]
|
||||
public class DeviceMTClient : IDriver
|
||||
{
|
||||
private EntityClient? _mClient;
|
||||
public ILogger _logger { get; set; }
|
||||
@ -26,7 +26,10 @@ namespace DriverMTConnect
|
||||
|
||||
#endregion
|
||||
|
||||
public MTConnectClient(string device, ILogger logger)
|
||||
#region 生命周期
|
||||
|
||||
|
||||
public DeviceMTClient(string device, ILogger logger)
|
||||
{
|
||||
_device = device;
|
||||
_logger = logger;
|
||||
@ -66,8 +69,16 @@ namespace DriverMTConnect
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
// Suppress finalization.
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 读写方法
|
||||
|
||||
|
||||
[Method("读MTConnect", description: "读MTConnect ID")]
|
||||
public DriverReturnValueModel ReadById(DriverAddressIoArgModel ioarg)
|
||||
{
|
||||
@ -106,5 +117,7 @@ namespace DriverMTConnect
|
||||
RpcResponse rpcResponse = new() { IsSuccess = false, Description = "设备驱动内未实现写入功能" };
|
||||
return rpcResponse;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,162 +0,0 @@
|
||||
using IoTClient.Clients.PLC;
|
||||
using PluginInterface;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace DriverAllenBradley
|
||||
{
|
||||
[DriverSupported("AllenBradley")]
|
||||
[DriverInfo("AllenBradley", "V1.0.0", "Copyright IoTGateway-IoTClient© 2022-01-15")]
|
||||
public class AllenBradley : IDriver
|
||||
{
|
||||
private AllenBradleyClient? _plc;
|
||||
|
||||
public ILogger _logger { get; set; }
|
||||
private readonly string _device;
|
||||
|
||||
#region 配置参数
|
||||
|
||||
[ConfigParameter("设备Id")] public string DeviceId { get; set; }
|
||||
|
||||
[ConfigParameter("IP地址")] public string IpAddress { get; set; } = "127.0.0.1";
|
||||
|
||||
[ConfigParameter("端口号")] public int Port { get; set; } = 44818;
|
||||
|
||||
[ConfigParameter("超时时间ms")] public int Timeout { get; set; } = 3000;
|
||||
|
||||
[ConfigParameter("最小通讯周期ms")] public uint MinPeriod { get; set; } = 3000;
|
||||
|
||||
#endregion
|
||||
|
||||
public AllenBradley(string device, ILogger logger)
|
||||
{
|
||||
_device = device;
|
||||
_logger = logger;
|
||||
|
||||
_logger.LogInformation($"Device:[{device}],Create()");
|
||||
}
|
||||
|
||||
public bool IsConnected
|
||||
{
|
||||
get { return _plc != null && _plc.Connected; }
|
||||
}
|
||||
|
||||
public bool Connect()
|
||||
{
|
||||
try
|
||||
{
|
||||
_plc = new AllenBradleyClient(IpAddress, Port);
|
||||
_plc.Open();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return IsConnected;
|
||||
}
|
||||
|
||||
public bool Close()
|
||||
{
|
||||
try
|
||||
{
|
||||
_plc?.Close();
|
||||
return !IsConnected;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
_plc = null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[Method("读西门子PLC标准地址", description: "读西门子PLC标准地址")]
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioarg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
|
||||
if (_plc != null && this.IsConnected)
|
||||
{
|
||||
try
|
||||
{
|
||||
switch (ioarg.ValueType)
|
||||
{
|
||||
case PluginInterface.DataTypeEnum.Bit:
|
||||
ret.Value = _plc.ReadBoolean(ioarg.Address).Value == true ? 1 : 0;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Bool:
|
||||
ret.Value = _plc.ReadBoolean(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.UByte:
|
||||
ret.Value = _plc.ReadByte(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Byte:
|
||||
ret.Value = (sbyte)_plc.ReadByte(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Uint16:
|
||||
ret.Value = _plc.ReadUInt16(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Int16:
|
||||
ret.Value = _plc.ReadInt16(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Uint32:
|
||||
ret.Value = _plc.ReadUInt32(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Int32:
|
||||
ret.Value = _plc.ReadInt32(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Float:
|
||||
ret.Value = _plc.ReadFloat(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Double:
|
||||
ret.Value = _plc.ReadDouble(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Uint64:
|
||||
ret.Value = _plc.ReadUInt64(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Int64:
|
||||
ret.Value = _plc.ReadInt64(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.AsciiString:
|
||||
ret.Value = _plc.ReadString(ioarg.Address);
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Utf8String:
|
||||
ret.Value = _plc.ReadString(ioarg.Address);
|
||||
break;
|
||||
default:
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = $"不支持的类型";
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = $"读取失败,{ex.Message}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = "连接失败";
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioarg)
|
||||
{
|
||||
RpcResponse rpcResponse = new() { IsSuccess = false, Description = "设备驱动内未实现写入功能" };
|
||||
return rpcResponse;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
namespace DriverModbusMaster;
|
||||
|
||||
public enum PlcType
|
||||
{
|
||||
S7200 = 0,
|
||||
S7300 = 1,
|
||||
S7400 = 2,
|
||||
S71200 = 3,
|
||||
S71500 = 4,
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
using PluginInterface;
|
||||
using SimpleTCP;
|
||||
using SimpleTCP;
|
||||
using PluginInterface;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace DriverSimTcpClient
|
||||
namespace Mock.TcpClient
|
||||
{
|
||||
[DriverSupported("SimTcpServerDevice")]
|
||||
[DriverInfo("SimTcpClient", "V1.0.0", "Copyright IoTGateway© 2022-06-04")]
|
||||
public class SimTcpClient : IDriver
|
||||
[DriverSupported("SimTcpClient")]
|
||||
[DriverInfo("SimTcpClient", "V1.0.0", "Copyright iotgateway.net 20230220")]
|
||||
public class DeviceTcpClient : IDriver
|
||||
{
|
||||
/// <summary>
|
||||
/// tcp客户端
|
||||
@ -40,7 +40,9 @@ namespace DriverSimTcpClient
|
||||
|
||||
#endregion
|
||||
|
||||
public SimTcpClient(string device, ILogger logger)
|
||||
#region 生命周期
|
||||
|
||||
public DeviceTcpClient(string device, ILogger logger)
|
||||
{
|
||||
_device = device;
|
||||
_logger = logger;
|
||||
@ -124,11 +126,17 @@ namespace DriverSimTcpClient
|
||||
{
|
||||
//释放资源
|
||||
_client?.Dispose();
|
||||
|
||||
// Suppress finalization.
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 读写方法
|
||||
|
||||
/// <summary>
|
||||
/// 发送数据
|
||||
@ -138,15 +146,15 @@ namespace DriverSimTcpClient
|
||||
/// <summary>
|
||||
/// 解析并返回
|
||||
/// </summary>
|
||||
/// <param name="ioarg">ioarg.Address为起始变量字节编号;ioarg.ValueType为类型</param>
|
||||
/// <param name="ioArg">ioArg.Address为起始变量字节编号;ioArg.ValueType为类型</param>
|
||||
/// <returns></returns>
|
||||
[Method("读模拟设备数据", description: "读模拟设备数据,开始字节和长度")]
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
ushort startIndex;
|
||||
//判断地址是否为整数
|
||||
if (!ushort.TryParse(ioarg.Address, out startIndex))
|
||||
if (!ushort.TryParse(ioArg.Address, out startIndex))
|
||||
{
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = "起始字节编号错误";
|
||||
@ -170,7 +178,7 @@ namespace DriverSimTcpClient
|
||||
else
|
||||
{
|
||||
//解析数据,并返回
|
||||
switch (ioarg.ValueType)
|
||||
switch (ioArg.ValueType)
|
||||
{
|
||||
case DataTypeEnum.UByte:
|
||||
case DataTypeEnum.Byte:
|
||||
@ -206,11 +214,13 @@ namespace DriverSimTcpClient
|
||||
}
|
||||
|
||||
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioarg)
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
RpcResponse rpcResponse = new() { IsSuccess = false, Description = "设备驱动内未实现写入功能" };
|
||||
await Task.CompletedTask;
|
||||
return rpcResponse;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public enum ConnectionType
|
@ -2,13 +2,13 @@
|
||||
using Automation.OPCClient;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace DriverOPCDaClient
|
||||
namespace OPC.DaClient
|
||||
{
|
||||
[DriverSupported("OPCDaClient")]
|
||||
[DriverInfo("OPCDaClient", "V1.0.0", "Copyright IoTGateway© 2022-08-10")]
|
||||
internal class OPCDaClient : IDriver
|
||||
[DriverInfo("OPCDaClient", "V1.0.0", "Copyright IoTGateway.net 20230220")]
|
||||
internal class DeviceDaClient : IDriver
|
||||
{
|
||||
private OPCClientWrapper? opcDaClient;
|
||||
private OPCClientWrapper? _opcDaClient;
|
||||
|
||||
public ILogger _logger { get; set; }
|
||||
private readonly string _device;
|
||||
@ -27,7 +27,14 @@ namespace DriverOPCDaClient
|
||||
|
||||
#endregion
|
||||
|
||||
public OPCDaClient(string device, ILogger logger)
|
||||
#region 生命周期
|
||||
|
||||
/// <summary>
|
||||
/// 反射构造函数
|
||||
/// </summary>
|
||||
/// <param name="device"></param>
|
||||
/// <param name="logger"></param>
|
||||
public DeviceDaClient(string device, ILogger logger)
|
||||
{
|
||||
_device = device;
|
||||
_logger = logger;
|
||||
@ -35,54 +42,80 @@ namespace DriverOPCDaClient
|
||||
_logger.LogInformation($"Device:[{_device}],Create()");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 连接状态
|
||||
/// </summary>
|
||||
public bool IsConnected => _opcDaClient != null && _opcDaClient.IsOPCServerConnected();
|
||||
|
||||
public bool IsConnected
|
||||
{
|
||||
get { return opcDaClient != null && opcDaClient.IsOPCServerConnected(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 连接
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool Connect()
|
||||
{
|
||||
try
|
||||
{
|
||||
opcDaClient = new OPCClientWrapper();
|
||||
opcDaClient.Init(Ip, OpcServerName);
|
||||
_logger.LogInformation($"Device:[{_device}],Connect()");
|
||||
|
||||
_opcDaClient = new OPCClientWrapper();
|
||||
_opcDaClient.Init(Ip, OpcServerName);
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation($"Device:[{_device}],Connect()");
|
||||
return false;
|
||||
}
|
||||
|
||||
return IsConnected;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 断开
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool Close()
|
||||
{
|
||||
try
|
||||
{
|
||||
opcDaClient?.Disconnect();
|
||||
_logger.LogInformation($"Device:[{_device}],Close()");
|
||||
|
||||
_opcDaClient?.Disconnect();
|
||||
return !IsConnected;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"Device:[{_device}],Close(),Error");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 释放
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
opcDaClient = null;
|
||||
_logger.LogInformation($"Device:[{_device}],Dispose()");
|
||||
|
||||
_opcDaClient = null;
|
||||
|
||||
// Suppress finalization.
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"Device:[{_device}],Dispose(),Error");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 读写方法
|
||||
|
||||
|
||||
[Method("读OPCDa", description: "读OPCDa节点")]
|
||||
public DriverReturnValueModel ReadNode(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadNode(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
|
||||
@ -90,8 +123,8 @@ namespace DriverOPCDaClient
|
||||
{
|
||||
try
|
||||
{
|
||||
var dataValue = opcDaClient?.ReadNodeLabel(ioarg.Address);
|
||||
switch (ioarg.ValueType)
|
||||
var dataValue = _opcDaClient?.ReadNodeLabel(ioArg.Address);
|
||||
switch (ioArg.ValueType)
|
||||
{
|
||||
case DataTypeEnum.Bit:
|
||||
ret.Value = dataValue == "On" ? 1 : 0;
|
||||
@ -129,7 +162,7 @@ namespace DriverOPCDaClient
|
||||
break;
|
||||
default:
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = $"读取失败,不支持的类型:{ioarg.ValueType}";
|
||||
ret.Message = $"读取失败,不支持的类型:{ioArg.ValueType}";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -149,7 +182,7 @@ namespace DriverOPCDaClient
|
||||
}
|
||||
|
||||
[Method("测试方法", description: "测试方法,返回当前时间")]
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
|
||||
@ -164,10 +197,14 @@ namespace DriverOPCDaClient
|
||||
return ret;
|
||||
}
|
||||
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioarg)
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
RpcResponse rpcResponse = new() { IsSuccess = false, Description = "设备驱动内未实现写入功能" };
|
||||
await Task.CompletedTask;
|
||||
return rpcResponse;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -1,15 +1,15 @@
|
||||
using PluginInterface;
|
||||
using Opc.Ua;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Opc.Ua;
|
||||
using OpcUaHelper;
|
||||
using PluginInterface;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace DriverOPCUaClient
|
||||
namespace OPC.UaClient
|
||||
{
|
||||
[DriverSupported("OPC UA")]
|
||||
[DriverInfo("OPCUaClient", "V1.0.0", "Copyright IoTGateway© 2021-12-19")]
|
||||
public class OPCUaClient : IDriver
|
||||
[DriverSupported("OPCUaClient")]
|
||||
[DriverInfo("OPCUaClient", "V1.0.0", "Copyright IoTGateway.net 20230220")]
|
||||
public class DeviceUaClient : IDriver
|
||||
{
|
||||
private OpcUaClientHelper? opcUaClient;
|
||||
private OpcUaClientHelper? _opcUaClient;
|
||||
public ILogger _logger { get; set; }
|
||||
private readonly string _device;
|
||||
|
||||
@ -26,7 +26,14 @@ namespace DriverOPCUaClient
|
||||
|
||||
#endregion
|
||||
|
||||
public OPCUaClient(string device, ILogger logger)
|
||||
#region 生命周期
|
||||
|
||||
/// <summary>
|
||||
/// 反射构造函数
|
||||
/// </summary>
|
||||
/// <param name="device"></param>
|
||||
/// <param name="logger"></param>
|
||||
public DeviceUaClient(string device, ILogger logger)
|
||||
{
|
||||
_device = device;
|
||||
_logger = logger;
|
||||
@ -34,54 +41,78 @@ namespace DriverOPCUaClient
|
||||
_logger.LogInformation($"Device:[{_device}],Create()");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 连接状态
|
||||
/// </summary>
|
||||
public bool IsConnected => _opcUaClient is { Connected: true };
|
||||
|
||||
public bool IsConnected
|
||||
{
|
||||
get { return opcUaClient != null && opcUaClient.Connected; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 连接
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool Connect()
|
||||
{
|
||||
try
|
||||
{
|
||||
opcUaClient = new OpcUaClientHelper();
|
||||
opcUaClient.ConnectServer(Uri).Wait(Timeout);
|
||||
_logger.LogInformation($"Device:[{_device}],Connect()");
|
||||
|
||||
_opcUaClient = new OpcUaClientHelper();
|
||||
_opcUaClient.ConnectServer(Uri).Wait(Timeout);
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation($"Device:[{_device}],Connect()");
|
||||
return false;
|
||||
}
|
||||
|
||||
return IsConnected;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 断开
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool Close()
|
||||
{
|
||||
try
|
||||
{
|
||||
opcUaClient?.Disconnect();
|
||||
_logger.LogInformation($"Device:[{_device}],Close()");
|
||||
|
||||
_opcUaClient?.Disconnect();
|
||||
return !IsConnected;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"Device:[{_device}],Close(),Error");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 释放
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
opcUaClient = null;
|
||||
_logger.LogInformation($"Device:[{_device}],Dispose()");
|
||||
_opcUaClient = null;
|
||||
|
||||
// Suppress finalization.
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"Device:[{_device}],Dispose(),Error");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
[Method("读OPCUa", description: "读OPCUa节点")]
|
||||
public DriverReturnValueModel ReadNode(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel ReadNode(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
|
||||
@ -89,7 +120,7 @@ namespace DriverOPCUaClient
|
||||
{
|
||||
try
|
||||
{
|
||||
var dataValue = opcUaClient?.ReadNode(new NodeId(ioarg.Address));
|
||||
var dataValue = _opcUaClient?.ReadNode(new NodeId(ioArg.Address));
|
||||
if (DataValue.IsGood(dataValue))
|
||||
ret.Value = dataValue?.Value;
|
||||
}
|
||||
@ -109,7 +140,7 @@ namespace DriverOPCUaClient
|
||||
}
|
||||
|
||||
[Method("测试方法", description: "测试方法,返回当前时间")]
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioarg)
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
|
||||
@ -124,9 +155,10 @@ namespace DriverOPCUaClient
|
||||
return ret;
|
||||
}
|
||||
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioarg)
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
RpcResponse rpcResponse = new() { IsSuccess = false, Description = "设备驱动内未实现写入功能" };
|
||||
await Task.CompletedTask;
|
||||
return rpcResponse;
|
||||
}
|
||||
}
|
@ -270,7 +270,7 @@ namespace OpcUaHelper
|
||||
return;
|
||||
}
|
||||
|
||||
m_session = m_reConnectHandler.Session;
|
||||
m_session = (Session)m_reConnectHandler.Session;
|
||||
m_reConnectHandler.Dispose( );
|
||||
m_reConnectHandler = null;
|
||||
|
@ -1,17 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<OutputPath>../../../IoTGateway/bin/Debug/net5.0/drivers</OutputPath>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="IoTClient" Version="1.0.22" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\PluginInterface\PluginInterface.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,160 +0,0 @@
|
||||
using IoTClient.Clients.PLC;
|
||||
using IoTClient.Enums;
|
||||
using PluginInterface;
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DriverOmronFins
|
||||
{
|
||||
[DriverSupported("OmronFins")]
|
||||
[DriverInfoAttribute("OmronFins", "V1.0.0", "Copyright WHD-IoTClient© 2022-01-15")]
|
||||
public class OmronFins : IDriver
|
||||
{
|
||||
private OmronFinsClient plc = null;
|
||||
#region 配置参数
|
||||
|
||||
[ConfigParameter("设备Id")]
|
||||
public Guid DeviceId { get; set; }
|
||||
|
||||
[ConfigParameter("IP地址")]
|
||||
public string IpAddress { get; set; } = "127.0.0.1";
|
||||
|
||||
[ConfigParameter("端口号")]
|
||||
public int Port { get; set; } = 6000;
|
||||
|
||||
[ConfigParameter("超时时间ms")]
|
||||
public int Timeout { get; set; } = 3000;
|
||||
|
||||
[ConfigParameter("最小通讯周期ms")]
|
||||
public uint MinPeriod { get; set; } = 3000;
|
||||
|
||||
#endregion
|
||||
|
||||
public OmronFins(Guid deviceId)
|
||||
{
|
||||
DeviceId = deviceId;
|
||||
}
|
||||
|
||||
|
||||
public bool IsConnected
|
||||
{
|
||||
get
|
||||
{
|
||||
return plc != null && plc.Connected;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Connect()
|
||||
{
|
||||
try
|
||||
{
|
||||
plc = new OmronFinsClient(IpAddress, Port);
|
||||
plc.Open();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return IsConnected;
|
||||
}
|
||||
|
||||
public bool Close()
|
||||
{
|
||||
try
|
||||
{
|
||||
plc?.Close();
|
||||
return !IsConnected;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
plc = null;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[Method("读西门子PLC标准地址", description: "读西门子PLC标准地址")]
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioarg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
|
||||
if (plc != null && this.IsConnected)
|
||||
{
|
||||
try
|
||||
{
|
||||
switch (ioarg.ValueType)
|
||||
{
|
||||
case PluginInterface.DataTypeEnum.Bit:
|
||||
ret.Value = plc.ReadBoolean(ioarg.Address).Value == true ? 1 : 0;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Bool:
|
||||
ret.Value = plc.ReadBoolean(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.UByte:
|
||||
ret.Value = plc.ReadByte(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Byte:
|
||||
ret.Value = (sbyte)plc.ReadByte(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Uint16:
|
||||
ret.Value =plc.ReadUInt16(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Int16:
|
||||
ret.Value = plc.ReadInt16(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Uint32:
|
||||
ret.Value =plc.ReadUInt32(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Int32:
|
||||
ret.Value = plc.ReadInt32(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Float:
|
||||
ret.Value = plc.ReadFloat(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Double:
|
||||
ret.Value = plc.ReadDouble(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Uint64:
|
||||
ret.Value = plc.ReadUInt64(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Int64:
|
||||
ret.Value = plc.ReadInt64(ioarg.Address).Value;
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.AsciiString:
|
||||
ret.Value = plc.ReadString(ioarg.Address);
|
||||
break;
|
||||
case PluginInterface.DataTypeEnum.Utf8String:
|
||||
ret.Value = plc.ReadString(ioarg.Address);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = $"读取失败,{ex.Message}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = "连接失败";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
BIN
Plugins/Drivers/Other.Toledo/.vs/DriverWeightTcpClient/v17/.suo
Normal file
BIN
Plugins/Drivers/Other.Toledo/.vs/DriverWeightTcpClient/v17/.suo
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
394
Plugins/Drivers/Other.Toledo/DeviceToledo.cs
Normal file
394
Plugins/Drivers/Other.Toledo/DeviceToledo.cs
Normal file
@ -0,0 +1,394 @@
|
||||
using SimpleTCP;
|
||||
using System.Text;
|
||||
using System.IO.Ports;
|
||||
using PluginInterface;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Other.Toledo
|
||||
{
|
||||
[DriverSupported("Toledo")]
|
||||
[DriverInfo("Toledo", "V1.0.0", "Copyright IoTGateway.net 20230220")]
|
||||
public class DeviceToledo : IDriver
|
||||
{
|
||||
/// <summary>
|
||||
/// tcp客户端
|
||||
/// </summary>
|
||||
private SimpleTcpClient? client;
|
||||
/// <summary>
|
||||
/// 缓存最新的服务器返回的原始数据
|
||||
/// </summary>
|
||||
private byte[]? latestRcvData;
|
||||
|
||||
private byte[] TempRcvData;
|
||||
private DateTime latestDate;
|
||||
|
||||
public ILogger _logger { get; set; }
|
||||
private readonly string _device;
|
||||
#region 配置参数
|
||||
|
||||
[ConfigParameter("设备Id")] public string DeviceId { get; set; }
|
||||
|
||||
[ConfigParameter("IP地址")]
|
||||
public string IpAddress { get; set; } = "127.0.0.1";
|
||||
|
||||
[ConfigParameter("端口号")]
|
||||
public int Port { get; set; } = 6666;
|
||||
|
||||
[ConfigParameter("数据位")]
|
||||
public int DataBits { get; set; } = 17;
|
||||
|
||||
[ConfigParameter("校验位")]
|
||||
public Parity Parity { get; set; } = Parity.None;
|
||||
|
||||
[ConfigParameter("停止位")]
|
||||
public StopBits StopBits { get; set; } = StopBits.One;
|
||||
|
||||
/// <summary>
|
||||
/// 为了演示枚举类型在web端的录入,这里没用到 但是你可以拿到
|
||||
/// </summary>
|
||||
[ConfigParameter("连接类型")]
|
||||
public ConnectionType ConnectionType { get; set; } = ConnectionType.Long;
|
||||
|
||||
[ConfigParameter("超时时间ms")]
|
||||
public int Timeout { get; set; } = 300;
|
||||
|
||||
[ConfigParameter("最小通讯周期ms")]
|
||||
public uint MinPeriod { get; set; } = 3000;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 生命周期
|
||||
|
||||
/// <summary>
|
||||
/// 反射构造函数
|
||||
/// </summary>
|
||||
/// <param name="device"></param>
|
||||
/// <param name="logger"></param>
|
||||
public DeviceToledo(string device, ILogger logger)
|
||||
{
|
||||
_device = device;
|
||||
_logger = logger;
|
||||
|
||||
_logger.LogInformation($"Device:[{_device}],Create()");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断连接状态
|
||||
/// </summary>
|
||||
public bool IsConnected
|
||||
{
|
||||
get
|
||||
{
|
||||
//客户端对象不为空并且客户端已连接则返回true
|
||||
return client != null && client.TcpClient != null && client.TcpClient.Connected;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 进行连接
|
||||
/// </summary>
|
||||
/// <returns>连接是否成功</returns>
|
||||
public bool Connect()
|
||||
{
|
||||
try
|
||||
{
|
||||
//进行连接
|
||||
client = new SimpleTcpClient().Connect(IpAddress, Port);
|
||||
client.DataReceived += Client_DataReceived;
|
||||
_logger.LogInformation($"Device:[{_device}],Connect()");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"Device:[{_device}],Connect()");
|
||||
return false;
|
||||
}
|
||||
return IsConnected;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 断开连接
|
||||
/// </summary>
|
||||
/// <returns>断开是否成功</returns>
|
||||
public bool Close()
|
||||
{
|
||||
try
|
||||
{
|
||||
client.DataReceived -= Client_DataReceived;
|
||||
//断开连接
|
||||
client?.Disconnect();
|
||||
|
||||
_logger.LogInformation($"Device:[{_device}],Close()");
|
||||
return !IsConnected;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"Device:[{_device}],Close()");
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 释放
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
//释放资源
|
||||
client?.Dispose();
|
||||
|
||||
// Suppress finalization.
|
||||
GC.SuppressFinalize(this);
|
||||
_logger.LogInformation($"Device:[{_device}],Dispose()");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"Device:[{_device}],Dispose()");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 读写方法
|
||||
/// <summary>
|
||||
/// 解析并返回
|
||||
/// </summary>
|
||||
/// <param name="ioArg">ioArg.Address为起始变量字节编号;ioArg.ValueType为类型</param>
|
||||
/// <returns></returns>
|
||||
[Method("读模拟设备数据", description: "读模拟设备数据,开始字节和长度")]
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
|
||||
//连接正常则进行读取
|
||||
if (IsConnected)
|
||||
{
|
||||
try
|
||||
{
|
||||
ushort address, count;
|
||||
ret = AnalyseAddress(ioArg, out address, out count);
|
||||
|
||||
|
||||
|
||||
if (
|
||||
(latestRcvData == null) ||
|
||||
(DateTime.Now.Subtract(latestDate).TotalSeconds > 10)
|
||||
)
|
||||
{
|
||||
latestRcvData = null;
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = "没有收到数据";
|
||||
|
||||
if (ioArg.ValueType == DataTypeEnum.Custome1)
|
||||
{
|
||||
ret.Value = latestDate;
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Good;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//解析数据,并返回
|
||||
switch (ioArg.ValueType)
|
||||
{
|
||||
case DataTypeEnum.UByte:
|
||||
|
||||
case DataTypeEnum.Byte:
|
||||
ret.Value = latestRcvData[address];
|
||||
break;
|
||||
case DataTypeEnum.Int16:
|
||||
ret.Value = (short)latestRcvData[address];
|
||||
//var buffer16 = latestRcvData.Skip(address).Take(count).ToArray();
|
||||
//ret.Value = BitConverter.ToInt16(buffer16[0], 0);
|
||||
break;
|
||||
case DataTypeEnum.Int32:
|
||||
//拿到有用的数据
|
||||
var bufferCustome1 = latestRcvData.Skip(address).Take(count).ToArray();
|
||||
|
||||
var strCustome1 = Encoding.ASCII.GetString(bufferCustome1);
|
||||
if (strCustome1.Contains("\0"))
|
||||
strCustome1 = strCustome1.Replace("\0", "");
|
||||
|
||||
ret.Value = strCustome1 == "" ? 0 : int.Parse(strCustome1);
|
||||
|
||||
break;
|
||||
case DataTypeEnum.Float:
|
||||
//拿到有用的数据
|
||||
var buffer32 = latestRcvData.Skip(address).Take(count).ToArray();
|
||||
//大小端转换一下
|
||||
ret.Value = BitConverter.ToSingle(buffer32, 0);
|
||||
break;
|
||||
case DataTypeEnum.AsciiString:
|
||||
//拿到有用的数据
|
||||
var bufferAscii = latestRcvData.Skip(address).Take(count).ToArray();
|
||||
|
||||
|
||||
var str = Encoding.ASCII.GetString(bufferAscii);
|
||||
if (str.Contains("\0"))
|
||||
str = str.Replace("\0", "");
|
||||
|
||||
ret.Value = str;
|
||||
break;
|
||||
case DataTypeEnum.Custome1:
|
||||
ret.Value = latestDate;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = $"读取失败,{ex.Message}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = "连接失败";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioArg)
|
||||
{
|
||||
RpcResponse rpcResponse = new() { IsSuccess = false, Description = "设备驱动内未实现写入功能" };
|
||||
await Task.CompletedTask;
|
||||
return rpcResponse;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 私有方法
|
||||
|
||||
private byte[] addBytes(byte[] data1, byte[] data2)
|
||||
{
|
||||
byte[] data3 = new byte[(data1 != null ? data1.Length : 0) + data2.Length]; ;
|
||||
|
||||
if (data1 != null)
|
||||
{
|
||||
data1.CopyTo(data3, 0);
|
||||
}
|
||||
if (data2 != null)
|
||||
data2.CopyTo(data3, data1 != null ? data1.Length : 0);
|
||||
|
||||
return data3;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 收到服务端数据
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Client_DataReceived(object? sender, Message e)
|
||||
{
|
||||
if (e.Data.Length == 0) { return; }
|
||||
|
||||
latestDate = DateTime.Now;
|
||||
|
||||
|
||||
//合并TempRcvData, e.Data
|
||||
byte[] RcvData = addBytes(TempRcvData, e.Data);
|
||||
|
||||
//_logger.LogInformation($"Device:[{_device}],TempRcvData:{BitConverter.ToString(TempRcvData)}," +
|
||||
// $"e.Data:{BitConverter.ToString(e.Data)},RcvData:{BitConverter.ToString(RcvData)}");
|
||||
|
||||
int index = RcvData.Length - 1;
|
||||
|
||||
if (RcvData.Length >= DataBits)
|
||||
{
|
||||
while (index > 0)
|
||||
{
|
||||
if (RcvData[index] != 0x0d)
|
||||
{
|
||||
index--;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (index + 1 >= DataBits && RcvData[index - DataBits + 1] == 0x02)
|
||||
{
|
||||
latestRcvData = new byte[DataBits];
|
||||
Array.Copy(RcvData, index - DataBits + 1, latestRcvData, 0, DataBits);
|
||||
|
||||
|
||||
if (RcvData.Length - index > 1)
|
||||
{
|
||||
TempRcvData = new byte[RcvData.Length - index];
|
||||
Array.Copy(RcvData, index + 1, TempRcvData, 0, RcvData.Length - index - 1);
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (latestRcvData != null) { Array.Clear(latestRcvData, 0, latestRcvData.Length); }
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (TempRcvData != null)
|
||||
{
|
||||
Array.Clear(TempRcvData, 0, TempRcvData.Length);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TempRcvData = RcvData;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 分析地址的开始地址和总位数
|
||||
/// </summary>
|
||||
/// <param name="ioarg"></param>
|
||||
/// <param name="StartAddress">起始位置</param>
|
||||
/// <param name="ReadCount">总位数</param>
|
||||
/// <returns></returns>
|
||||
private DriverReturnValueModel AnalyseAddress(DriverAddressIoArgModel ioarg, out ushort StartAddress, out ushort ReadCount)
|
||||
{
|
||||
DriverReturnValueModel ret = new() { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
try
|
||||
{
|
||||
if (ioarg.ValueType == DataTypeEnum.AsciiString)
|
||||
{
|
||||
StartAddress = ushort.Parse(ioarg.Address.Split(',')[0]);
|
||||
ReadCount = ushort.Parse(ioarg.Address.Split(',')[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
StartAddress = ushort.Parse(ioarg.Address);
|
||||
ReadCount = 1;
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ret.StatusType = VaribaleStatusTypeEnum.AddressError;
|
||||
ret.Message = ex.Message;
|
||||
StartAddress = 0;
|
||||
ReadCount = 0;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public enum ConnectionType
|
||||
{
|
||||
Long,
|
||||
Short
|
||||
}
|
||||
}
|
18
Plugins/Drivers/Other.Toledo/Other.Toledo.csproj
Normal file
18
Plugins/Drivers/Other.Toledo/Other.Toledo.csproj
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<OutputPath>../../../IoTGateway/bin/Debug/net6.0/drivers</OutputPath>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\PluginInterface\PluginInterface.csproj" />
|
||||
<PackageReference Include="SimpleTCP.Core" Version="1.0.4" />
|
||||
<PackageReference Include="System.IO.Ports" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,14 +1,15 @@
|
||||
using IoTClient.Clients.PLC;
|
||||
using PluginInterface;
|
||||
using PluginInterface;
|
||||
using IoTClient.Clients.PLC;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace DriverOmronFins
|
||||
namespace PLC.AllenBradley
|
||||
{
|
||||
[DriverSupported("OmronFins")]
|
||||
[DriverInfo("OmronFins", "V1.0.0", "Copyright IoTGateway-IoTClient© 2022-01-15")]
|
||||
public class OmronFins : IDriver
|
||||
[DriverSupported("AllenBradley")]
|
||||
[DriverInfo("AllenBradley", "V1.0.0", "Copyright IoTGateway.net 20230220")]
|
||||
public class DeviceAllenBradley : IDriver
|
||||
{
|
||||
private OmronFinsClient? _plc;
|
||||
private AllenBradleyClient? _plc;
|
||||
|
||||
public ILogger _logger { get; set; }
|
||||
private readonly string _device;
|
||||
|
||||
@ -18,7 +19,7 @@ namespace DriverOmronFins
|
||||
|
||||
[ConfigParameter("IP地址")] public string IpAddress { get; set; } = "127.0.0.1";
|
||||
|
||||
[ConfigParameter("端口号")] public int Port { get; set; } = 6000;
|
||||
[ConfigParameter("端口号")] public int Port { get; set; } = 44818;
|
||||
|
||||
[ConfigParameter("超时时间ms")] public int Timeout { get; set; } = 3000;
|
||||
|
||||
@ -26,24 +27,23 @@ namespace DriverOmronFins
|
||||
|
||||
#endregion
|
||||
|
||||
public OmronFins(string device, ILogger logger)
|
||||
#region 生命周期
|
||||
public DeviceAllenBradley(string device, ILogger logger)
|
||||
{
|
||||
_device = device;
|
||||
_logger = logger;
|
||||
|
||||
_logger.LogInformation($"Device:[{_device}],Create()");
|
||||
_logger.LogInformation($"Device:[{device}],Create()");
|
||||
}
|
||||
|
||||
public bool IsConnected
|
||||
{
|
||||
get { return _plc != null && _plc.Connected; }
|
||||
}
|
||||
public bool IsConnected => _plc is { Connected: true };
|
||||
|
||||
public bool Connect()
|
||||
{
|
||||
try
|
||||
{
|
||||
_plc = new OmronFinsClient(IpAddress, Port);
|
||||
_logger.LogInformation($"Device:[{_device}],Connect()");
|
||||
_plc = new AllenBradleyClient(IpAddress, Port);
|
||||
_plc.Open();
|
||||
}
|
||||
catch (Exception)
|
||||
@ -58,11 +58,13 @@ namespace DriverOmronFins
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.LogInformation($"Device:[{_device}],Close()");
|
||||
_plc?.Close();
|
||||
return !IsConnected;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex,$"Device:[{_device}],Close()");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -72,13 +74,22 @@ namespace DriverOmronFins
|
||||
try
|
||||
{
|
||||
_plc = null;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[Method("读西门子PLC标准地址", description: "读西门子PLC标准地址")]
|
||||
// Suppress finalization.
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
_logger.LogInformation($"Device:[{_device}],Dispose()");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, $"Device:[{_device}],Dispose(),Error");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 读写方法
|
||||
|
||||
[Method("读AllenBradleyPLC标准地址", description: "读AllenBradleyPLC标准地址")]
|
||||
public DriverReturnValueModel Read(DriverAddressIoArgModel ioarg)
|
||||
{
|
||||
var ret = new DriverReturnValueModel { StatusType = VaribaleStatusTypeEnum.Good };
|
||||
@ -90,7 +101,7 @@ namespace DriverOmronFins
|
||||
switch (ioarg.ValueType)
|
||||
{
|
||||
case DataTypeEnum.Bit:
|
||||
ret.Value = _plc.ReadBoolean(ioarg.Address).Value == true ? 1 : 0;
|
||||
ret.Value = _plc.ReadBoolean(ioarg.Address).Value ? 1 : 0;
|
||||
break;
|
||||
case DataTypeEnum.Bool:
|
||||
ret.Value = _plc.ReadBoolean(ioarg.Address).Value;
|
||||
@ -133,7 +144,7 @@ namespace DriverOmronFins
|
||||
break;
|
||||
default:
|
||||
ret.StatusType = VaribaleStatusTypeEnum.Bad;
|
||||
ret.Message = $"读取失败,不支持的类型:{ioarg.ValueType}";
|
||||
ret.Message = $"不支持的类型";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -155,7 +166,11 @@ namespace DriverOmronFins
|
||||
public async Task<RpcResponse> WriteAsync(string requestId, string method, DriverAddressIoArgModel ioarg)
|
||||
{
|
||||
RpcResponse rpcResponse = new() { IsSuccess = false, Description = "设备驱动内未实现写入功能" };
|
||||
await Task.CompletedTask;
|
||||
return rpcResponse;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user