Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

无法在画布上显示部分器件属性 #13

Open
Sheepfan0828 opened this issue Dec 23, 2024 · 1 comment
Open

无法在画布上显示部分器件属性 #13

Sheepfan0828 opened this issue Dec 23, 2024 · 1 comment

Comments

@Sheepfan0828
Copy link

Sheepfan0828 commented Dec 23, 2024

你好 我这里可以成功放置器件 但是有些通过setState方法设置的属性无法在画布上显示(已经用红色方框标出) 不过控制台里面可以输出我设置好的属性。
屏幕截图 2024-12-24 112823
如下是在画布里面的情况 右侧边栏上我也没有看到
屏幕截图 2024-12-24 113255
下面是我编写的代码

/**
 * 入口文件
 *
 * 本文件为默认扩展入口文件,如果你想要配置其它文件作为入口文件�?
 * 请修�? `extension.json` 中的 `entry` 字段�?
 *
 * 请在此处使用 `export`  导出所有你希望�? `headerMenus` 中引用的方法�?
 * 方法通过方法名与 `headerMenus` 关联�?
 *
 * 如需了解更多开发细节,请阅读:
 * https://prodocs.lceda.cn/cn/api/guide/
 */
import * as extensionConfig from '../extension.json';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function activate(status?: 'onStartupFinished', arg?: string): void {
    eda.sys_IFrame.openIFrame('/iframe/index.html', 500, 500);
}

export async function about(): Promise<void> {
    const library_uuid = await eda.lib_LibrariesList.getSystemLibraryUuid();
    if (!library_uuid) {
        throw new Error("Failed to get project library uuid!");
    }
    const comp_info = (await eda.lib_Device.search("0603WAF1002T5E", library_uuid)).shift();
    if (!comp_info) {
        throw new Error("Failed to create info");
    }
    const c_uuid = await comp_info.uuid;

    //console.log("libraryUuid: ", library_uuid, "uuid: ", c_uuid, "uuid from comp_info: ", await comp_info.libraryUuid);

    let comp = {libraryUuid: library_uuid, uuid: c_uuid};

    const c1  = await eda.sch_PrimitiveComponent.create(comp, 0, 0);
    if (!c1) {
        throw new Error("Failed to create ISCH_PrimitiveComponent.");
    }
    c1.setState_Name("ooo");
    c1.setState_Designator("D2");
    c1.setState_Mirror(true);
    const wd = c1.setState_OtherProperty({"overloadVoltage":"25v"});
    console.log("wd: ",wd);
    //c.setState_X(500);
    //c.setState_Y(500);
    c1.done();
}

请问如何解决这个问题?

@Sheepfan0828 Sheepfan0828 changed the title 为器件设置位号时出错 无法在画布上显示部分器件属性 Dec 24, 2024
@Sheepfan0828
Copy link
Author

其中还有一个很奇怪的一点 我使用setState_Designator方法设置器件位号 但是画布中却显示在描述里面

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant