Hello!
I have 5 MPs, three of them running in for cycle, so somehow I want to track which MP is solved in a particular time.
I imagined that, I make five label, with the name of the MPs, and for those string parameter I make annotation, which defines the mp's status (running, finished).
Can I make annotation for non indexed parameters?
The css code I use is the following (maybe that here misses something , without the annotation it's working )
.tag-widgetadata-widget\.uri="OptimizationLog_lbl_SMG1"] .annotation-Active{
border-radius: 5px;
background: rgb(17, 255, 125);
border-style: solid;
border-width: 5px;
border-color: rgb(17, 255, 125);
color: #fff;
}
Thanks for your help!
Page 1 / 1
Hi @Boglarka Balogh ,
You can generate annotations for non indexed parameters indeed. Please use the webui::AnnotationsIdentifier for this purpose, located at the bottom of every identifier's attribute window
However, it seems a bit cumbersome to create 1 string parameter for each of your mathematical program, and then assign it.
Why wouldn't you define a string parameter indexed over your MPs, and then assign an annotation to it ? it would work smoothly as well! :)
You can generate annotations for non indexed parameters indeed. Please use the webui::AnnotationsIdentifier for this purpose, located at the bottom of every identifier's attribute window
However, it seems a bit cumbersome to create 1 string parameter for each of your mathematical program, and then assign it.
Why wouldn't you define a string parameter indexed over your MPs, and then assign an annotation to it ? it would work smoothly as well! :)
code:
StringParameter SP_MP_Status {
IndexDomain: IndexMathematicalPrograms;
webui::AnnotationsIdentifier: SP_MP_annotation;
}
StringParameter SP_MP_annotation {
IndexDomain: IndexMathematicalPrograms;
}
Hello!
I've tried this way, but my css still doesn't recognize any annotation.
Here is my codes for the first label, which shows the first MP's state.
.aimms-widget .tag-label[data-widget\.uri="OptimizationLog_lbl_SMG1"] .label.annotation-Running1{
border-radius: 5px;
border-style: solid;
border-width: 5px;
border-color: rgb(17, 255, 125);
color: #fff;
}
.aimms-widget .tag-label[data-widget\.uri="OptimizationLog_lbl_SMG1"] .label.annotation-Finished1{
border-radius: 5px;
background-color: rgb(17, 255, 125);
color: #fff;
}
Can you spot what's wrong?
I've tried this way, but my css still doesn't recognize any annotation.
Here is my codes for the first label, which shows the first MP's state.
.aimms-widget .tag-label[data-widget\.uri="OptimizationLog_lbl_SMG1"] .label.annotation-Running1{
border-radius: 5px;
border-style: solid;
border-width: 5px;
border-color: rgb(17, 255, 125);
color: #fff;
}
.aimms-widget .tag-label[data-widget\.uri="OptimizationLog_lbl_SMG1"] .label.annotation-Finished1{
border-radius: 5px;
background-color: rgb(17, 255, 125);
color: #fff;
}
Can you spot what's wrong?
Hi @Boglarka Balogh , it looks like the Label and Button widgets do not recognize any annotations - which makes sense. They are not designed to represent any model data in the WebUI, whereas annotations are designed to communicate changes in model data to the visual component.
Perhaps you can create a subset of AllMathematicalPrograms like Arthur suggested, use a legend widget and control the color / background of the math program which is being solved ?
I use below CSS code to get the attached view. I'm sure if you play around, you will be able to do a lot of stuff.
Perhaps you can create a subset of AllMathematicalPrograms like Arthur suggested, use a legend widget and control the color / background of the math program which is being solved ?
I use below CSS code to get the attached view. I'm sure if you play around, you will be able to do a lot of stuff.
code:
/* hides the default colors in the legend widget */
.theme-aimms .annotation-hidden{
visibility: hidden;
}
/* makes the current mp's color as green */
.theme-aimms .annotation-running {
background: green;
}
/* hides the "Color" text in the legend widget with name MP */
.tag-legend-widget[data-widget\.uri="MP"] div.headers span:last-child{
visibility: hidden;
}
Reply
Sign up
Already have an account? Login
Please use your business or academic e-mail address to register
Login to the community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.