|
|
@@ -41,6 +41,7 @@ function OnException(err) {
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
// Callback Functions.
|
|
|
// 641a254c-ef3e-11ea-bc8a-379bb908bdd7
|
|
|
+/*
|
|
|
function OnGetFaceName(){
|
|
|
const str = unit.form.mainfrm.OnGetFaceName();
|
|
|
|
|
|
@@ -55,6 +56,28 @@ function OnGetFaceName(){
|
|
|
const centerMatch = str.match(centerRegex);
|
|
|
const centerCoords = centerMatch? centerMatch[1].split(' ').map(x => x.trim()) : null;
|
|
|
|
|
|
+ ui.type.value = typeInfo;
|
|
|
+ ui.xc.value = centerCoords[0];
|
|
|
+ ui.yc.value = centerCoords[1];
|
|
|
+ ui.zc.value = centerCoords[2];
|
|
|
+}*/
|
|
|
+
|
|
|
+function OnGetFaceName(){
|
|
|
+ const str = unit.form.mainfrm.OnGetFaceName();
|
|
|
+ console.log(str);
|
|
|
+ // 匹配type对应内容的正则表达式,以type:开头,后面跟着非冒号的内容直到遇到空格或者字符串结束
|
|
|
+ const typeRegex = /type:([^point]+)/;
|
|
|
+ // 匹配center坐标对应内容的正则表达式
|
|
|
+ //const centerRegex = /point:([\d. ]+)/;
|
|
|
+
|
|
|
+ const typeMatch = str.match(typeRegex);
|
|
|
+ const typeInfo = typeMatch? typeMatch[1] : null;
|
|
|
+
|
|
|
+ //const centerMatch = str.match(centerRegex);
|
|
|
+ //const centerCoords = centerMatch? centerMatch[1].split(' ').map(x => x.trim()) : null;
|
|
|
+ const match = str.match(/point:([-\d.]+)\s+([-\d.]+)\s+([-\d.]+)/);
|
|
|
+ const centerCoords = match.slice(1, 4);
|
|
|
+
|
|
|
ui.type.value = typeInfo;
|
|
|
ui.xc.value = centerCoords[0];
|
|
|
ui.yc.value = centerCoords[1];
|
|
|
@@ -356,7 +379,7 @@ function OnConnect(){
|
|
|
let name1 = unit.form.mainfrm.OnConnects(ui.cxs.value, ui.cys.value, ui.czs.value, ui.cxe.value, ui.cye.value, ui.cze.value, ui.cr.value, ui.cg.value, ui.cb.value, name);
|
|
|
|
|
|
name1 = name1.replace(temp, "");
|
|
|
- console.log(name1);
|
|
|
+ //console.log(name1);
|
|
|
unit.form.mainfrm.OnChangePicture(3, 2);
|
|
|
let color = unit.form.tree.getRandomHexColor();
|
|
|
let Load = {
|
|
|
@@ -499,7 +522,7 @@ function OnSpring(){
|
|
|
"unique":name
|
|
|
|
|
|
};
|
|
|
- console.log(name1);
|
|
|
+ //console.log(name1);
|
|
|
if(ui.stypes.value === '--' || ui.stypee.value === '--') {
|
|
|
unit.form.mainfrm.OnCueline('未添加弹簧坐标', 'green');
|
|
|
}else{
|
|
|
@@ -564,7 +587,7 @@ function OnBeam(){
|
|
|
"color":color,
|
|
|
"unique":name
|
|
|
};
|
|
|
- console.log(name1);
|
|
|
+ //console.log(name1);
|
|
|
unit.form.tree.CreateBoundary(Load, name1);
|
|
|
unit.form.mainfrm.OnCueline('您完成了梁约束的添加!', 'green');
|
|
|
}
|
|
|
@@ -598,7 +621,7 @@ function OnStart(){
|
|
|
|
|
|
function OnChangeMenu(){
|
|
|
ui.stack_menu.index = parseFloat(ui.misConstraints.index);
|
|
|
- console.log(ui.no_limit_constraint.index === 1);
|
|
|
+ // console.log(ui.no_limit_constraint.index === 1);
|
|
|
//console.log(ui.limit_constraint.index);
|
|
|
|
|
|
if(ui.stack_menu.index === 3){
|
|
|
@@ -623,7 +646,7 @@ function OnChangeConstraint(){
|
|
|
}
|
|
|
}
|
|
|
function ChangeRadiobutton(idx) {
|
|
|
- ui.limit_constraint.index = parseFloat(idx);
|
|
|
+ ui.limit_constraint.index = parseInt(idx);
|
|
|
}
|
|
|
//The message corresponding callback executed by the docker pane.
|
|
|
// when calling [side_pane].fireEvent(type,para) in the main form.
|
|
|
@@ -634,6 +657,11 @@ function OnParentDockerMessage(type, para) {
|
|
|
// Utils Functions.
|
|
|
// 6c165ad6-ef3e-11ea-987c-b761a131c2fe
|
|
|
|
|
|
+CW_DeclareVariable("idx",
|
|
|
+ val => {
|
|
|
+ ui.limit_constraint.index = val;
|
|
|
+ }, () => {});
|
|
|
+
|
|
|
CW_DeclareVariable("pb_x",
|
|
|
val => {
|
|
|
ui.pb_x.value = val;
|