[KiRi][Fixed] Issues with added/removed layers
- Similar to the sheets fix
This commit is contained in:
parent
0cad908dee
commit
24e9aa700f
|
|
@ -129,11 +129,13 @@ class KiRiOptions(VariantOptions):
|
|||
self.add_to_cache(name_copy, hash)
|
||||
return name_copy
|
||||
|
||||
def save_pcb_layers(self, hash=None):
|
||||
subdir = os.path.join(hash[:7], '_KIRI_') if hash is not None else ''
|
||||
def save_pcb_layers(self, hash):
|
||||
subdir = os.path.join(hash[:7], '_KIRI_')
|
||||
subdir_layers = os.path.join(self.cache_dir, subdir, 'pcb', 'layer-')
|
||||
with open(os.path.join(self.cache_dir, subdir, 'pcb_layers'), 'wt') as f:
|
||||
for la in self._solved_layers:
|
||||
f.write(str(la.id)+'|'+la.layer+'\n')
|
||||
if os.path.isfile(subdir_layers+('%02d' % la.id)+'.svg'):
|
||||
f.write(str(la.id)+'|'+la.layer+'\n')
|
||||
|
||||
def solve_layer_colors(self):
|
||||
# Color theme
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ var is_fullscreen = false;
|
|||
|
||||
var sheet_pages_commit1 = [];
|
||||
var sheet_pages_commit2 = [];
|
||||
var layers_commit1 = new Set();
|
||||
var layers_commit2 = new Set();
|
||||
|
||||
// =======================================
|
||||
// HANDLE SHORTCUTS
|
||||
|
|
@ -885,17 +887,21 @@ function update_layers_list(commit1, commit2, selected_layer_idx, selected_layer
|
|||
used_layers_1 = loadFile("../" + commit1 + "/_KIRI_/pcb_layers" + url_timestamp(commit1)).split("\n").filter((a) => a);
|
||||
used_layers_2 = loadFile("../" + commit2 + "/_KIRI_/pcb_layers" + url_timestamp(commit2)).split("\n").filter((a) => a);
|
||||
|
||||
layers_commit1 = new Set();
|
||||
for (const line of used_layers_1)
|
||||
{
|
||||
id = line.split("|")[0];
|
||||
layer = line.split("|")[1]; //.replace(".", "_");
|
||||
dict[id] = [layer];
|
||||
layers_commit1.add(pad(id, 2));
|
||||
}
|
||||
|
||||
layers_commit2 = new Set();
|
||||
for (const line of used_layers_2)
|
||||
{
|
||||
id = line.split("|")[0];
|
||||
layer = line.split("|")[1]; //.replace(".", "_");
|
||||
layers_commit2.add(pad(id, 2));
|
||||
|
||||
// Add new key
|
||||
if (! dict.hasOwnProperty(id)) {
|
||||
|
|
@ -1031,6 +1037,17 @@ function update_layer() {
|
|||
var image_path_1 = "../" + commit1 + "/_KIRI_/pcb/layer" + "-" + layer_id + ".svg";
|
||||
var image_path_2 = "../" + commit2 + "/_KIRI_/pcb/layer" + "-" + layer_id + ".svg";
|
||||
|
||||
if (layers_commit1.has(layer_id)) {
|
||||
image_path_1 = "../" + commit1 + "/_KIRI_/pcb/layer" + "-" + layer_id + ".svg";
|
||||
} else {
|
||||
image_path_1 = "blank.svg";
|
||||
}
|
||||
if (layers_commit2.has(layer_id)) {
|
||||
image_path_2 = "../" + commit2 + "/_KIRI_/pcb/layer" + "-" + layer_id + ".svg";
|
||||
} else {
|
||||
image_path_2 = "blank.svg";
|
||||
}
|
||||
|
||||
console.log("[PCB] layer_id =", layer_id);
|
||||
console.log("[PCB] image_path_1 =", image_path_1);
|
||||
console.log("[PCB] image_path_2 =", image_path_2);
|
||||
|
|
|
|||
Loading…
Reference in New Issue